-
Notifications
You must be signed in to change notification settings - Fork 10
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
Import spec v0.4 and add support for v0.4 Context #83
Conversation
Add the new version of the spec and begin to address the various issues encountered with mulitple versions. In this commit, move all the schema definitions across specs into a single schemas.go in the api package, and adapt the existing events template to benefit from that. The same DB of schema files is used by the generator to load all schemas in the beginning and resolve references through a custom resolver. Move the example and factory tests into the spec specific packages. The conformance tests do not pass yet as a few extra fields need to be set which is not possible yet because changes to the context (including links) have not been processed yet. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
TODO: need to check is the README is up to date with the latest code sample |
9d000e0
to
4c908bb
Compare
9cf5c58
to
cbe8b1f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 79.94% 78.35% -1.59%
==========================================
Files 48 100 +52
Lines 3291 7688 +4397
==========================================
+ Hits 2631 6024 +3393
- Misses 552 1444 +892
- Partials 108 220 +112 ☔ View full report in Codecov by Sentry. |
d068184
to
9925424
Compare
Add a new context type for new fields in the context introduced in v0.4. Create new interfaces to match the new fields as well and update the templates to use the new context and implement the new interfaces when the spec version is not 0.3.x. Add a new version of the test type that is used to test the generator code so that we can test generating for the new version. Updated the logic to generate the schema in a golang file to use it as a local schema database for the jsonschema library to validate documents. The schemas are precompiled at init time now, which simplifies the logic downstream in the code. Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
9925424
to
53dc41a
Compare
Add the spec-v0.4 submodule
Add the new version of the spec and begin to address the various
issues encountered with mulitple versions.
In this commit, move all the schema definitions across specs
into a single schemas.go in the api package, and adapt the existing
events template to benefit from that.
The same DB of schema files is used by the generator to load all
schemas in the beginning and resolve references through a custom
resolver.
Move the example and factory tests into the spec specific
packages. The conformance tests do not pass yet as a few extra
fields need to be set which is not possible yet because changes to
the context (including links) have not been processed yet.
Support for v04 Context
Add a new context type for new fields in the context introduced
in v0.4. Create new interfaces to match the new fields as well
and update the templates to use the new context and implement
the new interfaces when the spec version is not 0.3.x.
Add a new version of the test type that is used to test the
generator code so that we can test generating for the new version.
Updated the logic to generate the schema in a golang file to
use it as a local schema database for the jsonschema library
to validate documents. The schemas are precompiled at init
time now, which simplifies the logic downstream in the code.