Comments (2)
Opinions on various points:
vars
should allow schemas in addition to relative JSON Pointers
The vars
section should not only describe how to resolve the variables from an instance, but also support validation of user-supplied data when resolving the templates in other ways. This should work as follows, taken from Riverbed Technology's service definition format which made extensive use of this mechanism:
An entry in the "vars" field can either adjust the starting point for that resolution through a relative JSON pointer, or provide a schema, indicating that the value must be provided from an external source. Any schema, whether implied through the resource's schema or given explicitly, must describe a type that can be resolved through the rules for that variable as described in the URI templates standard (RFC 6570). Otherwise the resulting behavior is undefined.
While we found it to be a best practice to always be able to fully resolve the self link from the instance data, it doesn't seem to be something that should be strictly required.
Legacy pre-processing rules
Toss them. They're ugly and confusing and not worth the burden of carrying them forwards. It's also not horribly difficult to migrate from them to vars
. People who don't want to update them can keep using the Draft 04 meta-schema until they are ready to move forwards.
Templating $ref
No use case is given for this, and it introduces considerable complication. I move that this be dropped unless/until compelling use cases are identified. It clearly could do a lot of things, but it's not clear that those things are desirable.
from json-schema-spec.
Having split the most urgent portion of this out into #142, I am going to close this. It's an omnibus that is hard to discuss all at once.
Templating $ref
is not something I have heard anyone else request. If someone wants that, please open it as its own issue. The question in that issue should just be whether to template $ref
, yes or no. The question of whether templates use pre-processing, mapping, or some other mechanism should be decided separately and applied to all template uses (currently href
and base
, possibly also $ref
and rel
).
My comment tacked on more proposals about user input and validation. That's a complex topic, the requirements for which are being explored in #108 which is a better vehicle for the discussion (it's at least garnered a few comments, while this issue has not).
from json-schema-spec.
Related Issues (20)
- OneOf property is failing during OAS Schema Validation HOT 4
- Intended interplay between "type" and "enum" HOT 2
- Validation Regex Description (section 7.3.8) should follow format of other string validation types
- Enum : Clarification HOT 2
- Build failure due to Relative JSON Pointer specification HOT 1
- Pattern: clarification on whether leading and trailing delimiters are allowed or required HOT 2
- Omitted `prefixItems` vs empty HOT 1
- Evaluation path: relative to $ref resolved schema or resource/document root? HOT 4
- JSON
- Feature Request: Constraint for single occurrence of a property structure in JSON Schema HOT 1
- Use JSON Pointers instead of 'properties' or 'prefixItems' keywords HOT 16
- Json-schema HOT 1
- How do I get the use Json to get the "about" and "mention" property to work with several subjects? HOT 4
- Statement on annotation values is unclear
- To validate CRUD of table information with a single Json-Schema, we propose an attribute for PrimaryKey. HOT 3
- Futuristic
- owner
- Typo in section 8.2.3 of draft 7 leading to wrong information HOT 4
- String format validation for IP addresses with network mask
- File extension in $id HOT 2
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 json-schema-spec.