Giter Club home page Giter Club logo

Comments (4)

jonasschmidt avatar jonasschmidt commented on August 16, 2024

Hmm, ok. I will have a look what the spec has to say about it. But if it's not valid, it should give back a schema validation error, not run into an infinite recursion. So either way, it has to be fixed.

from ex_json_schema.

jonasschmidt avatar jonasschmidt commented on August 16, 2024

It's a bit hard to tell since the whole referencing referencing behaviour is not defined in an unambiguous way in the spec (see also json-schema/json-schema#83 for a lengthy discussion around optional inline dereferencing). But in your case, the $ref values are JSON Pointers (https://tools.ietf.org/html/rfc6901) and should begin with a /.

It might be that some validators are more lenient about it, but requiring the reference to be a valid JSON Pointer also removes some ambiguity around inline referencing, where #definitions could point to a subschema that is defined inline.

In any case, #/definitions/... is the correct way to do it and I will try to turn this into a validation error instead of an infinite recursion :)

from ex_json_schema.

jonasschmidt avatar jonasschmidt commented on August 16, 2024

Alright, it's "fixed" in 0.5.1 to raise a ExJsonSchema.Schema.InvalidSchemaError when encountering invalid paths in $refs.

Thanks for catching that one :)

from ex_json_schema.

chrismcg avatar chrismcg commented on August 16, 2024

👍 thanks for fixing

from ex_json_schema.

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.