Comments (4)
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.
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.
@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 $id
s 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.
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)
- Since we already have a new 2019-09 draft, would it be the case to create a draft-07 branch in this repository? Or right before adding info specific to 2019-09? HOT 3
- Truth table for conditional subschemas is incomplete HOT 15
- Link to "RFC 3339, section 5.6" is not correct
- Date format in green-tick example is not in ISO8601 format HOT 4
- Draft 2019-09: Use correct $schema URI HOT 1
- wrong use of allof instead of anyof? HOT 1
- Is it correct to define both pattern and format for type string property? HOT 3
- PR build previews do not include PDF version HOT 4
- Update to reflect the proper usage of $ref with #/$def/ JSON pointers HOT 1
- Migrate from Travis CI to GitHub Actions for build process HOT 3
- Migrate netlify build previews config to repo HOT 1
- Is there a default for a string's maxLength property if none is specified? HOT 1
- curious why the cover of the homepage is a big octopus? HOT 1
- Fix netlify build previews HOT 6
- Incorrect `$anchor` example in documentation
- Tuple validation, required elements in tuple HOT 2
- Small grammar issue (effect versus affect)
- condition and allOf HOT 1
- Typo in understanding json schema annotations
- Archive the repo 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 understanding-json-schema.