Skip to content

Commit

Permalink
fix invalid json schema (required field)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Dec 19, 2024
1 parent 4063c57 commit 20e8a60
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 36 deletions.
6 changes: 3 additions & 3 deletions schemas/deprecated.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"type": "object",
"additionalProperties": {
"type": "string"
},
"required": true
}
},
"replace": {
"type": "object",
Expand All @@ -19,6 +18,7 @@
}
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["old"]
}
}
43 changes: 20 additions & 23 deletions schemas/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"properties": {
"key": {
"description": "For documentation of a key",
"type": "string",
"required": true
"type": "string"
},
"value": {
"description": "For documentation of a tag (key and value)",
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["key"]
},
{
"type": "object",
Expand Down Expand Up @@ -78,13 +78,11 @@
"url",
"wikidata",
"wikipedia"
],
"required": true
]
},
"label": {
"description": "English label for the field caption. A field can reference the label of another by using that field's identifier contained in brackets (e.g. {field}), in which case also the field's terms will be referenced from that field.",
"type": "string",
"required": true
"type": "string"
},
"geometry": {
"description": "If specified, only show the field for these kinds of geometry",
Expand Down Expand Up @@ -176,57 +174,55 @@
"properties": {
"key": {
"description": "The key of the required tag",
"type": "string",
"required": true
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["key"]
},
{
"$id": "requires-key-equals-value",
"type": "object",
"properties": {
"key": {
"description": "The key of the required tag",
"type": "string",
"required": true
"type": "string"
},
"value": {
"description": "The value that the tag must have. (alternative to 'valueNot')",
"type": "string",
"required": true
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["key", "value"]
},
{
"$id": "requires-key-not-value",
"type": "object",
"properties": {
"key": {
"description": "The key of the required tag",
"type": "string",
"required": true
"type": "string"
},
"valueNot": {
"description": "The value that the tag cannot have. (alternative to 'value')",
"type": "string",
"required": true
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["key", "valueNot"]
},
{
"$id": "requires-not-key",
"type": "object",
"properties": {
"keyNot": {
"description": "A key that must not be present",
"type": "string",
"required": true
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["keyNot"]
}
]
},
Expand Down Expand Up @@ -281,6 +277,7 @@
}
},
"additionalProperties": false,
"required": ["type", "label"],
"anyOf": [
{ "$id": "field-type-without-key-nor-keys", "properties": { "type": { "enum": ["restrictions"] } }, "allOf": [
{ "not": { "required": ["key"] }},
Expand Down
18 changes: 8 additions & 10 deletions schemas/preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"properties": {
"name": {
"description": "The English name for the feature. A preset can reference the label of another by using that preset's identifier contained in brackets (e.g. {preset}), in which case also the preset's aliases and terms will also be referenced from that preset.",
"type": "string",
"required": true
"type": "string"
},
"geometry": {
"description": "Valid geometry types for the feature, in order of preference",
Expand All @@ -16,16 +15,14 @@
"items": {
"type": "string",
"enum": ["point", "vertex", "line", "area", "relation"]
},
"required": true
}
},
"tags": {
"description": "Tags that must be present for the preset to match",
"type": "object",
"additionalProperties": {
"type": "string"
},
"required": true
}
},
"addTags": {
"description": "Tags that are added when changing to the preset (default is the same value as 'tags')",
Expand Down Expand Up @@ -93,15 +90,15 @@
"properties": {
"key": {
"description": "For documentation of a key",
"type": "string",
"required": true
"type": "string"
},
"value": {
"description": "For documentation of a tag (key and value)",
"type": "string"
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["key"]
},
"replacement": {
"description": "The ID of a preset that is preferable to this one",
Expand Down Expand Up @@ -129,5 +126,6 @@
"additionalProperties": false
}
},
"additionalProperties": false
"additionalProperties": false,
"required": ["name", "geometry", "tags"]
}

0 comments on commit 20e8a60

Please sign in to comment.