Code Monkey home page Code Monkey logo

Comments (6)

awwright avatar awwright commented on May 17, 2024

extends probably doesn't do what you think it does. It's actually implemented wrong in the library right now. According to the specification, extends takes an array of additional schemas to validate against. In v4, it was renamed to allOf, so if you'd like this functionality, use that instead, which is implemented correctly. Using extends should be considered deprecated.

Is this what you were looking for?

from jsonschema.

vanthome avatar vanthome commented on May 17, 2024

Hi, I look for a functionality which allows me to inherit certain common attributes from something like a base schema to multiple other schemas -- think inheritance.
I just researched a bit and I think you're completely right... in v4 terms what I'm seeking for is "allOf."
Is this already supported by this lib?

from jsonschema.

awwright avatar awwright commented on May 17, 2024

Yes, this is in the current master branch, as is anyOf and oneOf. We still need some documentation to describe that fact, which will come along with more v4 features sometime soon.

from jsonschema.

vanthome avatar vanthome commented on May 17, 2024

Maybe join forces with this effort I've found yesterday:
https://github.com/geraintluff/tv4
?

from jsonschema.

awwright avatar awwright commented on May 17, 2024

To accomplish what? If you're looking for other specific functionality, then you should probably open a new issue. And if you've found the functionality you were originally looking for, you should probably close this one.

from jsonschema.

vanthome avatar vanthome commented on May 17, 2024

This was just a hint that there are other efforts to implement a v4 compatible validator.
I close this.
Many thanks!

from jsonschema.

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.