Files
iD/data/presets/schema/preset.json
2019-12-13 14:31:43 -05:00

124 lines
4.3 KiB
JSON

{
"title": "Preset",
"description": "Associates an icon, form fields, and other UI with a set of OSM tags",
"type": "object",
"properties": {
"name": {
"description": "The English name for the feature",
"type": "string",
"required": true
},
"geometry": {
"description": "Valid geometry types for the feature, in order of preference",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"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')",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"removeTags": {
"description": "Tags that are removed when changing to another preset (default is the same value as 'addTags' which in turn defaults to 'tags')",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"fields": {
"description": "Default form fields that are displayed for the preset",
"type": "array",
"items": {
"type": "string"
}
},
"moreFields": {
"description": "Additional form fields that can be attached with the 'Add field' dropdown",
"type": "array",
"items": {
"type": "string"
}
},
"icon": {
"description": "Name of preset icon which represents this preset",
"type": "string"
},
"imageURL": {
"description": "The URL of a remote image that is more specific than 'icon'",
"type": "string"
},
"terms": {
"description": "English synonyms or related terms",
"type": "array",
"items": {
"type": "string"
}
},
"searchable": {
"description": "Whether or not the preset will be suggested via search",
"type": "boolean",
"default": true
},
"matchScore": {
"description": "The quality score this preset will receive when being compared with other matches (higher is better)",
"type": "number",
"default": 1.0
},
"reference": {
"description": "Taginfo documentation parameters (to be used when a preset manages multiple tags)",
"type": "object",
"properties": {
"key": {
"description": "For documentation of a key",
"type": "string",
"required": true
},
"value": {
"description": "For documentation of a tag (key and value)",
"type": "string"
}
},
"additionalProperties": false
},
"replacement": {
"description": "The ID of a preset that is preferable to this one",
"type": "string"
},
"countryCodes": {
"description": "Countries where to display the preset, as lowercase ISO 3166-1 alpha-2 codes (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[a-z]{2}$"
}
},
"notCountryCodes": {
"description": "Countries where NOT to display the preset, as lowercase ISO 3166-1 alpha-2 codes (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[a-z]{2}$"
}
}
},
"additionalProperties": false
}