Comments (8)
Looking forward to have this available
from jsonschema-rs.
Hope to get back to this feature soon :)
from jsonschema-rs.
Now there's Draft 2020-12
from jsonschema-rs.
We should be able to implement both 2019-09 and 2020-12 in one go I think. Here's my understanding of the work to be done:
Work to be done
Based on the changes from Draft-07 to 2019-09
Annotations, errors and outputs
- Implement collection of annotations whilst evaluating schemas
- Implement the "basic" output format to provide access to collected
annotations
Core vocabulary changes
- Split the various keywords into different vocabularies and implement
processing of the$vocabulary
keyword to determine which keywords are
available to a schema - Implement
$anchor
keyword - Disallow use of fragments in
$id
(that usecase being taken up by$anchor
) - Implement
$definitions
keyword - Implement
$recursiveRef
and$recursiveAnchor
(these are renamed to
$dynamicRef
and$dynamicAnchor
in 2020-12 but the latter is a superset of
the former so we can use the same implementation)
Applicator Vocabulary
- Split
dependencies
intodependentSchemas
anddependentRequired
- Implement
unevaluatedItems
andunevaluatedProperties
Format changes
- Add an option to turn off processing of the
format
keyword and instead
merely make it available as an annotation - Implement the
duration
anduuid
format validators - Make
contentEncoding
available as an annotation and not as an assertion - Implement the
contentSchema
keyword
Validation
- Implement
maxContains
andminContains
Meta-data
- Implement
deprecated
Based on changes from 2019-09 to 2020-12
- replace
items
andadditionalItems
withprefixItems
andites
- implement
$dynamicRef
and$dynamicAnchor
(see above re.$recursive*
versions)
Common components
- Ensure that items which pass a
contains
schema are not processed by an
unevaluatedItems
schema. This is not specified in 2019-09 but is compatible
from jsonschema-rs.
Great write-up, @alexjg !
I have some small bits here and there (maybe incomplete):
Here is also some existing (but not yet merged) implementation for needed keywords. It might help to implement those keywords here.
I like the plan and would be happy to split it into granular tasks! I'll also check it in more detail in a few days.
I think some changes could be done and merged, but we may not expose them (e.g. new keyword impls) until their respective drafts are ready. So, there should be no problem with accumulating changes step-by-step. Though, we can still test them high-level via some cfg(test)
items - e.g. conditional Draft201909
enum variant.
What do you think if we approach the implementation this way?
from jsonschema-rs.
That seems like a sensible way to proceed. I'm going to make a start on the annotation collection and output formatting part as that feels like it's the largest change architecturally.
from jsonschema-rs.
Great!
Here are separate issues for the entries above.
2019-09
Annotations, errors and outputs
Core vocabulary changes
Format changes
I added new keyword implementation as sub-tasks in existing issues for their relevant drafts (this one and #195 ).
from jsonschema-rs.
I'll set up conditional compilation for testing & merge existing keywords implementation, so we can run tests & add new one easier. It should be pretty much isolated, so I hope we can avoid conflicting changes.
from jsonschema-rs.
Related Issues (20)
- SystemError: <method 'validate' of 'jsonschema_rs.JSONSchema' objects> returned a result with an exception set HOT 3
- [Python] Add .pyi "stub" file for type checkers support HOT 1
- http and file resolver should be added via optional features HOT 3
- multipleOf logic produces incorrect results HOT 1
- Try compile tauri in wasm target , encountered some problems
- Incomplete basic output HOT 1
- Roadmap for 1.0 HOT 7
- Invalid universal2 wheel HOT 2
- Python: Switch to `maturin` HOT 3
- Schema with pattern re-compute regexp on each validate call HOT 7
- Performance: Cache `format: regex`
- 0.17: Infinite recursion in compilation HOT 1
- Improper handling of subschema validation in `unevaluatedProperties`.
- Using $ref resolver outside validation
- `JSONSchema` and `JSONPointer` donβt follow naming conventions HOT 1
- Incorrect `schema_path` in errors HOT 1
- [python] ValueError: Unsupported type: 'collections.OrderedDict'
- `Error: Error("expected ident", line: 1, column: 2)` when running from command line
- OneOfNotValid having uninformative description?
- python linux aarch64/arm64 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonschema-rs.