Comments (3)
Ah ok, that's a library-specific feature not defined in the standard that this library doesn't support. JSON Schema supports ways of bundling multiple schemas as described here though: http://json-schema.org/understanding-json-schema/structuring.html#bundling
from ex_json_schema.
Hey, if you need help with creating a valid schema with references, there are resources on https://json-schema.org/ that should get you started. The schema you are referencing here is not valid (you can also check with online validators like https://www.jsonschemavalidator.net/ but they won't give you different results).
from ex_json_schema.
I'm working with @Teifion on this, and our use case is that we have a bunch of individual JSONSchemas that describe different request and response endpoints for our API, rather than the entire API being one big JSONSchema file itself. Some of these requests and response schemas share refs to other schemas, but we don't know if it's possible for this library to load schemas with refs to previously loaded schemas.
I'm working on the client side of things using Typescirpt and AJV (JSONSchema validator), and I can supply an array of schemas and it will resolve the refs to other schemas.
const ajv = new Ajv({
schemas: [
{
'$id': 'address',
type: 'object',
properties: { line_1: { type: 'string' }, line_2: { type: 'string' } },
required: [ 'line_1', 'line_2' ]
},
{
'$id': 'person',
type: 'object',
properties: { name: { type: 'string' }, address: { '$ref': 'address' } },
required: [ 'name', 'address' ]
}
]
});
const validator = ajv.getSchema("person");
Is something like this possible for elixir using this lib?
from ex_json_schema.
Related Issues (20)
- Needs more validation error details HOT 3
- Improper resolution of referenced subschema HOT 6
- Map.take deprecation HOT 2
- Add contributors with merge rights HOT 1
- Warning messages when running with Elixir 1.9.1 & OTP 22 HOT 2
- Intent to implement: custom string validation HOT 1
- Changelog HOT 2
- IO.inspect in hex package HOT 2
- Examples on usage HOT 3
- Error on extra attributes? HOT 1
- Elixir 1.11 deprecations HOT 1
- Feature request: make enum, properties, propertyNames and additionalProperties (or the actual schema) available for custom errors HOT 4
- Support custom formats for non-string types HOT 5
- I cant see why I'm getting this error
- Any plans to support 2019 and 2020 ? HOT 6
- Issue with oneOf when used in conjunction with pattern HOT 7
- No support for dependentRequired HOT 2
- Make schema domain configurable HOT 1
- Error line number 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 ex_json_schema.