2021-11-07 17:17:48 +01:00
export default {
2022-07-18 00:30:57 +02:00
"type" : "object" ,
"properties" : {
"id" : {
"description" : "An id/name for this filter, used to set the URL parameters" ,
"type" : "string"
} ,
"options" : {
2023-03-09 15:13:03 +01:00
"description" : " The options for a filter \ nIf there are multiple options these will be a list of radio buttons \ nIf there is only one option this will be a checkbox \ nFiltering is done based on the given osmTags that are compared to the objects in that layer . \ n \ nAn example which searches by name : \ n \ n ` ` ` \ n{ \ n \ "id \ ": \ "shop-name \ ", \ n \ "options \ ": [ \ n { \ n \ "fields \ ": [ \ n { \ n \ "name \ ": \ "search \ ", \ n \ "type \ ": \ "string \ " \ n } \ n ], \ n \ "osmTags \ ": \ "name~i~.*{search}.* \ ", \ n \ "question \ ": { \ n \ "en \ ": \ "Only show shops with name {search} \ ", \ n } \ n } \ n ] \ n } \ n ` ` ` " ,
2022-07-18 00:30:57 +02:00
"type" : "array" ,
"items" : {
"type" : "object" ,
"properties" : {
"question" : { } ,
"osmTags" : {
2023-06-21 17:13:09 +02:00
"description" : "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag" ,
2022-07-18 00:30:57 +02:00
"anyOf" : [
{
2023-06-21 17:13:09 +02:00
"$ref" : "#/definitions/{and:TagConfigJson[];}"
2022-07-18 00:30:57 +02:00
} ,
{
2023-06-21 17:13:09 +02:00
"$ref" : "#/definitions/{or:TagConfigJson[];}"
2022-07-18 00:30:57 +02:00
} ,
{
"type" : "string"
}
]
} ,
"default" : {
"type" : "boolean"
} ,
"fields" : {
2022-01-26 21:40:38 +01:00
"type" : "array" ,
"items" : {
2022-07-18 00:30:57 +02:00
"type" : "object" ,
"properties" : {
"name" : {
"description" : "If name is `search`, use \"_first_comment~.*{search}.*\" as osmTags" ,
"type" : "string"
2022-01-26 21:40:38 +01:00
} ,
2022-07-18 00:30:57 +02:00
"type" : {
"type" : "string"
}
} ,
"required" : [
"name"
]
}
}
} ,
"required" : [
"question"
]
}
2023-03-09 15:13:03 +01:00
} ,
"#" : {
"description" : "Used for comments or to disable a check\n\n\"ignore-possible-duplicate\": disables a check in `DetectDuplicateFilters` which complains that a filter can be replaced by a filter from the `filters`-library-layer" ,
"type" : "string"
2022-07-18 00:30:57 +02:00
}
} ,
"required" : [
"id" ,
"options"
] ,
"definitions" : {
"TagConfigJson" : {
2023-06-21 17:13:09 +02:00
"description" : "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag" ,
2022-07-18 00:30:57 +02:00
"anyOf" : [
{
2023-06-21 17:13:09 +02:00
"$ref" : "#/definitions/{and:TagConfigJson[];}"
2022-07-18 00:30:57 +02:00
} ,
{
"type" : "object" ,
"properties" : {
"or" : {
"type" : "array" ,
"items" : {
"$ref" : "#/definitions/TagConfigJson"
}
2022-04-04 04:54:06 +02:00
}
2022-07-18 00:30:57 +02:00
} ,
"required" : [
"or"
]
} ,
{
"type" : "string"
2022-04-04 04:54:06 +02:00
}
2022-07-18 00:30:57 +02:00
]
2022-04-04 04:54:06 +02:00
} ,
2023-06-21 17:13:09 +02:00
"{and:TagConfigJson[];}" : {
2022-07-18 00:30:57 +02:00
"type" : "object" ,
"properties" : {
"and" : {
"type" : "array" ,
"items" : {
"$ref" : "#/definitions/TagConfigJson"
}
2022-01-26 21:40:38 +01:00
}
2022-07-18 00:30:57 +02:00
} ,
"required" : [
"and"
]
2022-04-04 04:54:06 +02:00
} ,
2023-06-21 17:13:09 +02:00
"{or:TagConfigJson[];}" : {
2022-07-18 00:30:57 +02:00
"type" : "object" ,
"properties" : {
"or" : {
"type" : "array" ,
"items" : {
"$ref" : "#/definitions/TagConfigJson"
}
}
} ,
"required" : [
"or"
]
2023-10-30 13:45:44 +01:00
} ,
"Record<string,string>" : {
"type" : "object"
2022-07-18 00:30:57 +02:00
}
} ,
"$schema" : "http://json-schema.org/draft-07/schema#"
2021-11-07 17:17:48 +01:00
}