Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: allow resources to be added from a map directly. #137

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

mathieuk
Copy link

This change allows users to add a resource to the compiler that was already loaded and unmarshal'ed elsewhere. In my use-case it helps me from needing to re-marshal a schema I already loaded before being able to add it to the jsonschema compiler.

…here

- add a basic test for AddResourceFromMap
compiler.go Outdated Show resolved Hide resolved
compiler.go Outdated Show resolved Hide resolved
compiler_test.go Outdated Show resolved Hide resolved
resource.go Outdated Show resolved Hide resolved
Mathieu Kooiman added 2 commits October 17, 2023 13:45
- adjust AddResource to use AddResource JSON
- use `interface{}` instead of `any`
- simplify test to avoid draft version issues
- tweak test to just evaluate based on `type` property
compiler.go Outdated Show resolved Hide resolved
compiler_test.go Outdated Show resolved Hide resolved
resource.go Outdated Show resolved Hide resolved
- remove testfile I added
- typos
- update comments
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (ce3bd6e) 89.21% compared to head (bd51ceb) 89.11%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
- Coverage   89.21%   89.11%   -0.11%     
==========================================
  Files          10       10              
  Lines        2651     2654       +3     
==========================================
  Hits         2365     2365              
- Misses        237      239       +2     
- Partials       49       50       +1     
Files Coverage Δ
compiler.go 89.02% <100.00%> (-0.42%) ⬇️
resource.go 80.62% <100.00%> (-0.30%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@santhosh-tekuri santhosh-tekuri merged commit a8fd7ed into santhosh-tekuri:master Oct 18, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants