Git Product home page Git Product logo

Comments (4)

Julian avatar Julian commented on May 22, 2024 1

I think #729 is a positive change (for the reasons you mentioned, so you've got my vote), but yeah doesn't help the key issue which is having to do two passes (or, having to do one, ahead of time pass to collect them, followed by a lazy lookup once you've collected those kinds of refs).

The only thing I think that'd help that is having a designated section for location-independent refs so that you don't need 2 passes and can just know to always look there, but I think I remember you saying there are reasons that the way things are now is needed or convenient for authors, so yeah definitely not saying I have all the answers on that one.

from understanding-json-schema.

Julian avatar Julian commented on May 22, 2024

It definitely supports id+ref generally, but what that seems likely to be trying to say at the minute is the "location independent" references which aare indeed not supported yet (and are a pain to implement. But some day I guess it will have to happen).

from understanding-json-schema.

handrews avatar handrews commented on May 22, 2024

@Julian would json-schema-org/json-schema-spec#729 make this any easier or harder?

IIRC the problem was doing the pre-scan to find all of the "$id": "#foo" anchors, so changing that to "$anchor": "foo" would not really make that easier.

Although it would arguably make it less confusing: instead of being this weird well... some $ids work and some don't situation, it would just be $anchor is not supported. So that would seem to be a slight argument in favor of #729? (Recall that I brought up putting it in draft-08 after all a couple of weeks ago).

from understanding-json-schema.

handrews avatar handrews commented on May 22, 2024

We now have more clarity in the spec on why you would want to use $id outside of a document root, and have also split out the use case in this section of Understanding JSON Schema into the $anchor keyword, which should make all of this less confusing.

The section referenced by this bug should now talk about $anchor, and the rest of $id's behavior should show up somewhere else (I don't know if it already does in the current book or if we'll need to add that).

from understanding-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.