Code Monkey home page Code Monkey logo

Comments (8)

aexvir avatar aexvir commented on June 6, 2024

Looking forward to have this available πŸ™‚οΈ

from jsonschema-rs.

Stranger6667 avatar Stranger6667 commented on June 6, 2024

Hope to get back to this feature soon :)

from jsonschema-rs.

fimbault avatar fimbault commented on June 6, 2024

Now there's Draft 2020-12

from jsonschema-rs.

alexjg avatar alexjg commented on June 6, 2024

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 into dependentSchemas and dependentRequired
  • Implement unevaluatedItems and unevaluatedProperties

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 and uuid format validators
  • Make contentEncoding available as an annotation and not as an assertion
  • Implement the contentSchema keyword

Validation

  • Implement maxContains and minContains

Meta-data

  • Implement deprecated

Based on changes from 2019-09 to 2020-12

  • replace items and additionalItems with prefixItems and ites
  • 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.

Stranger6667 avatar Stranger6667 commented on June 6, 2024

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.

alexjg avatar alexjg commented on June 6, 2024

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.

Stranger6667 avatar Stranger6667 commented on June 6, 2024

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.

Stranger6667 avatar Stranger6667 commented on June 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.