Schema as Meta-programmingRelational representation - TBDOverviewSourcesAlgorithmGraphLegendMeta$schema: uri$id: uri-reference$ref: uri-referencedefinitions: Schema{}type: (string | string[]) => booleanPredicate1 = (data, any[]) => booleanrequired: string[]enum: any[]Predicate0 (data, primitive) => booleanmultipleOf: numbermaximum: numberexclusiveMaximum: number | booleanminimum: numberexclusiveMinimum: number | booleanmaxLength: numberminLength: numberpattern: regexmaxItems: numberminItems: numberuniqueItems: booleanmaxProperties: numberminProperties: numberconst: anyformat: stringLogicalif-then-else: (data, Schema) => booleanallOf, anyOf, oneOf: (data, Schema[]) => booleanoneOf implementationnot: (data, Schema) => boolean? contains: Schema? dependencies: Schema | Schema[]DeductoradditionalItems: Schemaitems: Schema | Schema[]additionalProperties: Schemaproperties: Schema{}patternProperties: Schema{}propertyNames: SchemaUItitle: stringdescription: string$comment: stringdefault: anyexamples: any[]?ControlsreadOnly: booleanwriteOnly: booleancontentMediaType: stringcontentEncoding: stringType constraints
= (data, Schema!) => boolean
index | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
---|---|---|---|---|---|---|---|---|---|
value | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | |
acc := !(v && or) | 1 | 1 | 1 | 1 | 1 | 0 | |||
or := v || or | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
acc ? while : return or | -> | -> | -> | -> | -> | ! | |||
result | 0 | 0 | 0 | 1 | 1 | 1 | 0 |
= (data, Schema!) => (data[k], Schema[k])
type | indexOf | min/max | reg | includes | special |
---|---|---|---|---|---|
null | - | - | - | - | - |
boolean | enum | ... | - | - | - |
number/integer | enum | min/max, exclusiveMin/Max | - | multipleOf | - |
string | enum | min/maxLength | pattern, format | pattern | - |
array | additionaltems | min/maxItems | - | contains | uniqueItems |
object | additionalProperties | min/maxProperties | patternProperties | - | required, propertyNames |