Comments (3)
I would like to make the x-orderOf property a subschema, but here's an initial approach:
"head": {
"x-orderOf": {
"type": "object",
"properties": {
"@component": {
"$comment": "x-orderOf-StatementContentModel",
"minOccurs": "0",
"maxOccurs": "unbounded"
},
"@unit": {
"$comment": "x-orderOf-StatementContentModel",
"minOccurs": "0",
"maxOccurs": "unbounded"
},
"@meta": {
"$comment": "x-orderOf-StatementContentModel",
"minOccurs": "0",
"maxOccurs": "unbounded"
}
}
},
"type": "object",
"properties": {
"-children": {
"$ref": "#/$defs/-childStatements"
},
"@class": { "$comment": "SFString inputOutput", "type": "string" }, "component": { "$ref": "#/$defs/component" }, "@id": { "$comment": "SFString inputOutput", "type": "string" }, "meta": { "$ref": "#/$defs/meta" }, "@style": { "$comment": "SFString inputOutput", "type": "string" }, "unit": { "$ref": "#/$defs/unit" } }, "additionalProperties": false },```
from ajv.
Hi @coderextreme, thanks for your interest in AJV. I am not sure I completely understand the problem yet, but I wonder, have you looked into the custom keyword feature?
I believe you should be able to achieve what you need without any changes to AJV itself. I once wrote a simple form generation function that used custom keywords and the recursive behaviour of AJV to create forms out of custom defined schemas so it should be possible.
from ajv.
from ajv.
Related Issues (20)
- `oneOf` with coercion produces the wrong coerced value HOT 2
- Change Linter HOT 2
- Why regex pattern not works ? HOT 1
- Runtime discriminator to be able to support useDefaults within anyOf/oneOf HOT 1
- Unexpected behavior with removeAdditional and minProperties HOT 2
- Default export broken for typescript moduleResolution node16 HOT 11
- Contains object property with unknown key matching a schema HOT 1
- Distinction between addVocabulary and addKeyword in the docs
- Documentation dead links HOT 1
- Toss a Warning instead of throwing an error when adding a keyword HOT 6
- Ref within def does not act consistently
- JSONSchemaType $ref doesn't work in array type. HOT 5
- oneOf returns unwanted errors HOT 1
- Description key set as boolean returns error that it must be string HOT 2
- Validate and infer JSON Schema validated data type: introducing type providers HOT 3
- JTD schema parser errors on empty properties field HOT 1
- additionalProperties shouldn't affect TypeScript types from JTDDataType HOT 10
- option compile from addKeyword doesn't change on a remove and then add again HOT 2
- OneOf validation issue 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 ajv.