Comments (2)
The short answer is that it doesn't matter. Use whatever you like.
That said, keep in mind that schema identifiers can't be relative as they are in your example. Whether or not I would use an extension depends on the URI scheme being used. If using http(s):
, I wouldn't use an extension https://example.com/schemas/address
) because that's the convention for the http(s):
URI scheme.
However, what I prefer is to not use $id
and allow the file's location on the file system to be the be the schema's identifier (file:///path/to/schema/address.schema.json
). In this case, the identifier includes the extension because the file has an extension. References to this schema are file system relative, so you'll see references like, ./address.schema.json
for this schema.
from json-schema-spec.
@andriy-dmytruk, to clarify, the JSON Schema specification explicitly recommends in section 8.2.1.1 that $id
be included with a fully-qualified (absolute), fragment-less URI to serve as a base identifier.
Self identification holds the highest priority according to the URI specification, section 5.1, whereas file location holds the second lowest.
from json-schema-spec.
Related Issues (20)
- 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 HOT 1
- To validate CRUD of table information with a single Json-Schema, we propose an attribute for PrimaryKey. HOT 4
- 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 HOT 1
- Output unit schema inconsistent with spec HOT 4
- Question about references ($ref) HOT 2
- Implement a common language style throughout the specifications HOT 2
- pattern matching key/value strings with propertyDependencies / how to require properties with a match? HOT 6
- Clarify how schemas embedded inside other document types are identified
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.