santhosh-tekuri / jsonschema

JSONSchema (draft 2020-12, draft 2019-09, draft-7, draft-6, draft-4) Validation using Go
Apache License 2.0
957 stars 98 forks source link

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

Closed mathieuk closed 1 year ago

mathieuk commented 1 year ago

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.

codecov-commenter commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

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

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/santhosh-tekuri/jsonschema/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Santhosh+Kumar+Tekuri) | Coverage Δ | | |---|---|---| | [compiler.go](https://app.codecov.io/gh/santhosh-tekuri/jsonschema/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Santhosh+Kumar+Tekuri#diff-Y29tcGlsZXIuZ28=) | `89.02% <100.00%> (-0.42%)` | :arrow_down: | | [resource.go](https://app.codecov.io/gh/santhosh-tekuri/jsonschema/pull/137?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Santhosh+Kumar+Tekuri#diff-cmVzb3VyY2UuZ28=) | `80.62% <100.00%> (-0.30%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.