Skip to content

Commit

Permalink
make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bhelx committed Dec 2, 2024
1 parent 3680e6c commit 7b7950c
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 458 deletions.
266 changes: 135 additions & 131 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,11 @@
},
"additionalProperties": false
},
"Schema": {
"oneOf": [
{
"$ref": "#/$defs/ObjectSchema"
},
{
"$ref": "#/$defs/EnumSchema"
}
]
},
"ObjectSchema": {
"ObjectProperty": {
"type": "object",
"properties": {
"description": {
"type": "string"
"type": {
"const": "object"
},
"properties": {
"type": "object",
Expand All @@ -203,34 +193,43 @@
"items": {
"type": "string"
}
},
"description": {
"type": "string"
},
"nullable": {
"type": "boolean",
"default": false
}
},
"required": [
"type",
"properties"
],
"additionalProperties": false
},
"EnumSchema": {
"EnumProperty": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"string"
]
},
"description": {
"type": "string"
"const": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-zA-Z_$][a-zA-Z0-9_$]*$"
"type": "string"
}
},
"description": {
"type": "string"
},
"nullable": {
"type": "boolean",
"default": false
}
},
"required": [
"type",
"enum"
],
"additionalProperties": false
Expand Down Expand Up @@ -292,7 +291,7 @@
},
"items": {
"type": "object",
"$ref": "#/$defs/ArrayItem"
"$ref": "#/$defs/Property"
}
},
"required": [
Expand All @@ -311,18 +310,7 @@
"type": "string"
},
"additionalProperties": {
"allOf": [
{
"$ref": "#/$defs/NonMapProperty"
},
{
"type": "object",
"properties": {
"description": false
},
"additionalProperties": false
}
]
"$ref": "#/$defs/Property"
},
"nullable": {
"type": "boolean",
Expand All @@ -337,26 +325,123 @@
"contentType"
]
},
"NonMapProperty": {
"Property": {
"oneOf": [
{
"$ref": "#/$defs/ValueProperty"
},
{
"$ref": "#/$defs/RefProperty"
},
{
"$ref": "#/$defs/MapProperty"
}
]
},
"Property": {
"oneOf": [
"Schema": {
"allOf": [
{
"$ref": "#/$defs/ValueProperty"
"oneOf": [
{
"$ref": "#/$defs/ObjectProperty"
},
{
"$ref": "#/$defs/EnumProperty"
},
{
"$ref": "#/$defs/ValueProperty"
},
{
"$ref": "#/$defs/RefProperty"
},
{
"$ref": "#/$defs/MapProperty"
}
]
},
{
"$ref": "#/$defs/RefProperty"
"type": "object",
"if": {
"allOf": [
{
"properties": {
"type": {
"const": "boolean"
}
}
},
{
"required": [
"format"
]
}
]
},
"then": false
},
{
"$ref": "#/$defs/MapProperty"
"type": "object",
"if": {
"allOf": [
{
"properties": {
"type": {
"const": "string"
}
}
},
{
"required": [
"format"
]
}
]
},
"then": {
"properties": {
"format": {
"enum": [
"date-time",
"byte"
]
}
}
}
},
{
"type": "object",
"if": {
"allOf": [
{
"properties": {
"type": {
"const": "integer"
}
}
},
{
"required": [
"format"
]
}
]
},
"then": {
"properties": {
"format": {
"enum": [
"uint8",
"int8",
"uint16",
"int16",
"uint32",
"int32",
"uint64",
"int64"
]
}
}
}
}
]
},
Expand All @@ -378,7 +463,7 @@
},
"items": {
"type": "object",
"$ref": "#/$defs/ArrayItem"
"$ref": "#/$defs/Property"
}
},
"required": [
Expand All @@ -396,19 +481,7 @@
"type": "string"
},
"additionalProperties": {
"allOf": [
{
"$ref": "#/$defs/NonMapProperty"
},
{
"not": {
"type": "object",
"required": [
"description"
]
}
}
]
"$ref": "#/$defs/Property"
},
"nullable": {
"type": "boolean",
Expand Down Expand Up @@ -466,88 +539,19 @@
"XtpFormat": {
"type": "string",
"enum": [
"uint8",
"int8",
"uint16",
"int16",
"uint32",
"int32",
"uint64",
"int64",
"float",
"double",
"date-time",
"byte"
]
},
"ArrayItem": {
"type": "object",
"oneOf": [
{
"$ref": "#/$defs/ValueArrayItem"
},
{
"$ref": "#/$defs/RefArrayItem"
},
{
"$ref": "#/$defs/MapArrayItem"
}
]
},
"ValueArrayItem": {
"type": "object",
"properties": {
"type": {
"$ref": "#/$defs/XtpType"
},
"format": {
"$ref": "#/$defs/XtpFormat"
},
"nullable": {
"type": "boolean"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"RefArrayItem": {
"type": "object",
"properties": {
"$ref": {
"$ref": "#/$defs/SchemaReference"
},
"nullable": {
"type": "boolean",
"default": false
}
},
"required": [
"$ref"
],
"additionalProperties": false
},
"MapArrayItem": {
"type": "object",
"properties": {
"type": {
"const": "object"
},
"additionalProperties": {
"allOf": [
{
"$ref": "#/$defs/NonMapProperty"
},
{
"not": {
"type": "object",
"required": [
"description"
]
}
}
]
}
},
"required": [
"additionalProperties"
],
"additionalProperties": false
}
}
}
Loading

0 comments on commit 7b7950c

Please sign in to comment.