From b3c0cf63a656458493cb7adf387f2bf2fc0a65f4 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Mon, 9 Oct 2023 18:02:38 +0200 Subject: [PATCH 1/7] Add JSON schema definition and build utilities --- .githooks/pre-commit | 49 ++++++ .githooks/pre-push | 44 ++++++ Makefile | 23 +++ README.md | 26 ++++ draft/geocodejson.schema.json | 1 + draft/geocodejson.schema.json.checksum | 1 + src/geocodejson.schema.json | 200 +++++++++++++++++++++++++ 7 files changed, 344 insertions(+) create mode 100755 .githooks/pre-commit create mode 100755 .githooks/pre-push create mode 100644 Makefile create mode 100644 README.md create mode 100644 draft/geocodejson.schema.json create mode 100644 draft/geocodejson.schema.json.checksum create mode 100644 src/geocodejson.schema.json diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..a9fbdaf --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,49 @@ +#!/bin/bash + +INPUT_DIR=src +OUTPUT_DIR=draft + +SCHEMA_FILE=geocodejson.schema.json + +SHA_CMD=shasum +SHA_VERSION=512 +SHA_PREFIX="sha$SHA_VERSION" + +NPX_CMD=npx +JSON_DEREFERENCE_CLI_VERSION="0.1.2" +BUNDLE_SCHEMA_CMD="$NPX_CMD -y json-dereference-cli@$JSON_DEREFERENCE_CLI_VERSION" + +# JSON schema file must exist +if [ ! -f "$INPUT_DIR/$SCHEMA_FILE" ] +then + echo "$SCHEMA_FILE file in $INPUT_DIR folder is missing, abort" + exit 1 +fi + +# npx must be installed +if ! command -v $NPX_CMD &> /dev/null +then + echo "$NPX_CMD could not be found, please install it" + exit 1 +fi + +# Create bundles +$BUNDLE_SCHEMA_CMD -s $INPUT_DIR/$SCHEMA_FILE -o $OUTPUT_DIR/$SCHEMA_FILE 2> /dev/null + +# shasum must be installed +if ! command -v $SHA_CMD &> /dev/null +then + echo "$SHA_CMD could not be found, please install it" + exit 1 +fi + +# Compute checksums +SHA_SCHEMA_CHECKSUM=`$SHA_CMD -a $SHA_VERSION $OUTPUT_DIR/$SCHEMA_FILE | cut -d" " -f 1` + +echo "Checksum ($OUTPUT_DIR/$SCHEMA_FILE.checksum): $SHA_PREFIX-$SHA_SCHEMA_CHECKSUM" +echo -n "$SHA_PREFIX-$SHA_SCHEMA_CHECKSUM" > $OUTPUT_DIR/$SCHEMA_FILE.checksum + +# Stage new checksums +git add $OUTPUT_DIR/$SCHEMA_FILE.checksum + +exit 0 diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..6cd0e2c --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,44 @@ +#!/bin/bash + +INPUT_DIR=src +OUTPUT_DIR=draft + +SCHEMA_FILE=geocodejson.schema.json + +SHA_CMD=shasum +SHA_VERSION=512 +SHA_PREFIX="sha$SHA_VERSION" + +# JSON schema file must exist +if [ ! -f "$OUTPUT_DIR/$SCHEMA_FILE" ] +then + echo "$SCHEMA_FILE file in $INPUT_DIR folder is missing, abort" + exit 1 +fi + +# shasum must be installed +if ! command -v $SHA_CMD &> /dev/null +then + echo "$SHA_CMD could not be found, please install it" + exit 1 +fi + +# Checksums must exists +if [ ! -f "$OUTPUT_DIR/$SCHEMA_FILE.checksum" ] +then + echo "$SCHEMA_FILE.checksum file in $OUTPUT_DIR folder is missing, abort" + exit 1 +fi + +# Compute checksums +SHA_SCHEMA_CHECKSUM=`$SHA_CMD -a $SHA_VERSION $OUTPUT_DIR/$SCHEMA_FILE | cut -d" " -f 1` + +if ! grep "$SHA_PREFIX-$SHA_SCHEMA_CHECKSUM" $OUTPUT_DIR/$SCHEMA_FILE.checksum &>/dev/null +then + echo "Wrong checksum for $OUTPUT_DIR/$SCHEMA_FILE, please verify" + exit 1 +else + echo "Checksum ($OUTPUT_DIR/$SCHEMA_FILE): $SHA_PREFIX-$SHA_SCHEMA_CHECKSUM" +fi + +exit 0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eeee0a6 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +AJV_CLI_VERSION ?= 5.0.0 +JSON_DEREFERENCE_CLI_VERSION ?= 0.1.2 + +hooks: + echo "Installing git hooks" + cp .githooks/* .git/hooks/ + +checksum: + echo "Computing spec checksum" + .githooks/pre-commit + +verify: + .githooks/pre-push && echo "Checksum ok" + +bundle: + echo "Building spec bundle" + npx -y json-dereference-cli@$(JSON_DEREFERENCE_CLI_VERSION) -s src/geocodejson.schema.json -o draft/geocodejson.schema.json + +validate: + echo "Validating spec bundle" + npx -y ajv-cli@$(AJV_CLI_VERSION) compile --spec=draft2020 -s draft/geocodejson.schema.json + +build: bundle validate checksum verify diff --git a/README.md b/README.md new file mode 100644 index 0000000..37000d8 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# GeocodeJSON Specification + +An attempt to have standard geojson responses from geocoders. + +## How to use + +Please read the full spec at [master/draft/README.md](https://github.com/jenkin/geocodejson-spec/blob/master/draft/README.md). + +You can validate a geocoding service response against this GeocodeJSON spec using the JSON schema provided: [master/draft/geocodejson.schema.json](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json). Refer to [JSON Schema official website](https://json-schema.org/) for further informations. + +Please verify the integrity of the JSON schema using the SHA-512 checksum provided: [master/draft/geocodejson.schema.json.checksum](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json.checksum). + +## How to contribute + +Pre-requisites: [git](https://git-scm.com/), [make](https://www.gnu.org/software/make/), shasum [npx](https://www.npmjs.com/package/npx) (node and npm). + +Please follow these steps: + +- Let the community knows you want to contibute opening an issue +- Fork this repo, clone it locally and create a new branch +- Install git hooks running `make hooks` +- Extend the [draft document]((https://github.com/jenkin/geocodejson-spec/blob/master/draft/README.md)) +- Update the [JSON schema](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json) in `src/` folder +- Run `make build` +- If all is ok, commit your changes and push them +- Open a Pull Request on the main branch of this repo diff --git a/draft/geocodejson.schema.json b/draft/geocodejson.schema.json new file mode 100644 index 0000000..d1a47e9 --- /dev/null +++ b/draft/geocodejson.schema.json @@ -0,0 +1 @@ +{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","type":"object","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}],"properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]},"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[a-zA-Z0-9]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html).","examples":["Ehugh5oofiToh9aWe3heemu7ighee8"]}},"required":["type"]}},"required":["geocoding"]}}}}},"required":["geocoding"]} \ No newline at end of file diff --git a/draft/geocodejson.schema.json.checksum b/draft/geocodejson.schema.json.checksum new file mode 100644 index 0000000..d6b11e3 --- /dev/null +++ b/draft/geocodejson.schema.json.checksum @@ -0,0 +1 @@ +sha512-70edfabdacbbe4814c967585e99b58e80dda2dc963c5ab6bad16636acf081fc1c1608f0167930861db49e46a5de7e5b44079508370657873448dd36e0cc4d283 \ No newline at end of file diff --git a/src/geocodejson.schema.json b/src/geocodejson.schema.json new file mode 100644 index 0000000..9c18eda --- /dev/null +++ b/src/geocodejson.schema.json @@ -0,0 +1,200 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json", + "title": "GeocodeJSON Schema", + "description": "GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.", + "type": "object", + "allOf": [ + { + "$ref": "https://geojson.org/schema/GeoJSON.json" + } + ], + "properties": { + "type": { + "const": "FeatureCollection", + "description": "REQUIRED. GeocodeJSON result is a FeatureCollection." + }, + "geocoding": { + "type": "object", + "description": "REQUIRED. Namespace.", + "properties": { + "version": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "description": "REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.", + "examples": [ + "0.1.0", + "1.0.0-beta1", + "2.2.4" + ] + }, + "licence": { + "type": "string", + "description": "OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.", + "examples": [ + "ODbL" + ] + }, + "attribution": { + "type": "string", + "description": "OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.", + "examples": [ + "OpenStreetMap Contributors" + ] + }, + "query": { + "type": "string", + "description": "OPTIONAL. Default: null. The query that has been issued to trigger the search.", + "examples": [ + "24 allée de Bercy 75012 Paris" + ] + } + }, + "required": [ + "version" + ] + }, + "features": { + "type": "array", + "description": "REQUIRED. As per GeoJSON spec.", + "items": { + "type": "object", + "description": "OPTIONAL. An array of feature objects.", + "properties": { + "type": { + "const": "Feature", + "description": "REQUIRED. As per GeoJSON spec." + }, + "properties": { + "type": "object", + "description": "REQUIRED. As per GeoJSON spec.", + "properties": { + "geocoding": { + "type": "object", + "description": "REQUIRED. Namespace.", + "properties": { + "type": { + "type": "string", + "description": "REQUIRED. One of house, street, locality, city, region, country.", + "examples": [ + "house", + "street", + "district", + "city", + "county", + "state", + "country", + "locality" + ] + }, + "accuracy": { + "type": "number", + "minimum": 0, + "description": "OPTIONAL. Result accuracy, in meters.", + "examples": [ + 20 + ] + }, + "label": { + "type": "string", + "description": "RECOMMENDED. Suggested label for the result.", + "examples": [ + "My Shoes Shop, 64 rue de Metz 59280 Armentières" + ] + }, + "name": { + "type": "string", + "description": "OPTIONAL. Name of the place.", + "examples": [ + "My Shoes Shop" + ] + }, + "housenumber": { + "type": "string", + "description": "OPTIONAL. Housenumber of the place.", + "examples": [ + "64" + ] + }, + "street": { + "type": "string", + "description": "OPTIONAL. Street of the place.", + "examples": [ + "Rue de Metz" + ] + }, + "locality": { + "type": "string", + "description": "OPTIONAL. Locality of the place.", + "examples": [ + "Les Clarons" + ] + }, + "postcode": { + "type": "string", + "description": "OPTIONAL. Postcode of the place.", + "examples": [ + "59280" + ] + }, + "city": { + "type": "string", + "description": "OPTIONAL. City of the place.", + "examples": [ + "Armentières" + ] + }, + "district": { + "type": "string", + "description": "OPTIONAL. District of the place." + }, + "county": { + "type": "string", + "description": "OPTIONAL. County of the place." + }, + "state": { + "type": "string", + "description": "OPTIONAL. State of the place." + }, + "country": { + "type": "string", + "description": "OPTIONAL. Country of the place.", + "examples": [ + "France" + ] + }, + "admin": { + "type": "object", + "description": "OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.", + "patternProperties": { + "^level[0-9]+": { + "type": "string" + } + } + }, + "geohash": { + "type": "string", + "pattern": "^[a-zA-Z0-9]+(:.+)?$", + "description": "OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html).", + "examples": [ + "Ehugh5oofiToh9aWe3heemu7ighee8" + ] + } + }, + "required": [ + "type" + ] + } + }, + "required": [ + "geocoding" + ] + } + } + } + } + }, + "required": [ + "geocoding" + ] +} \ No newline at end of file From 1baad0288445a9d69f0782d3be7469bb92ac8589 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Tue, 10 Oct 2023 09:31:08 +0200 Subject: [PATCH 2/7] Refactor JSON schema --- Makefile | 2 +- draft/geocodejson.schema.json | 2 +- draft/geocodejson.schema.json.checksum | 2 +- src/geocodejson.schema.json | 349 +++++++++++++------------ 4 files changed, 187 insertions(+), 168 deletions(-) diff --git a/Makefile b/Makefile index eeee0a6..3ff67d8 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,6 @@ bundle: validate: echo "Validating spec bundle" - npx -y ajv-cli@$(AJV_CLI_VERSION) compile --spec=draft2020 -s draft/geocodejson.schema.json + npx -y ajv-cli@$(AJV_CLI_VERSION) compile -s draft/geocodejson.schema.json build: bundle validate checksum verify diff --git a/draft/geocodejson.schema.json b/draft/geocodejson.schema.json index d1a47e9..a26b0f6 100644 --- a/draft/geocodejson.schema.json +++ b/draft/geocodejson.schema.json @@ -1 +1 @@ -{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","type":"object","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}],"properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]},"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[a-zA-Z0-9]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html).","examples":["Ehugh5oofiToh9aWe3heemu7ighee8"]}},"required":["type"]}},"required":["geocoding"]}}}}},"required":["geocoding"]} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}],"$defs":{"FeatureCollectionGeocoding":{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},"FeatureGeocoding":{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}}} \ No newline at end of file diff --git a/draft/geocodejson.schema.json.checksum b/draft/geocodejson.schema.json.checksum index d6b11e3..71c019b 100644 --- a/draft/geocodejson.schema.json.checksum +++ b/draft/geocodejson.schema.json.checksum @@ -1 +1 @@ -sha512-70edfabdacbbe4814c967585e99b58e80dda2dc963c5ab6bad16636acf081fc1c1608f0167930861db49e46a5de7e5b44079508370657873448dd36e0cc4d283 \ No newline at end of file +sha512-b89618c2ff62349d13d1e3dfeffa6243a6e102ce7c4eb11c6b214440cdbc5da7cc2c5d02573dcbb73fb0eabb368c5f065221039cb48527443be0c54a0b2cbccb \ No newline at end of file diff --git a/src/geocodejson.schema.json b/src/geocodejson.schema.json index 9c18eda..fbc4b22 100644 --- a/src/geocodejson.schema.json +++ b/src/geocodejson.schema.json @@ -1,200 +1,219 @@ { - "$schema": "https://json-schema.org/draft/2020-12/schema", + "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json", "title": "GeocodeJSON Schema", "description": "GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.", - "type": "object", "allOf": [ { "$ref": "https://geojson.org/schema/GeoJSON.json" + }, + { + "$ref": "#/$defs/FeatureCollectionGeocoding" + }, + { + "$ref": "#/$defs/FeatureGeocoding" } ], - "properties": { - "type": { - "const": "FeatureCollection", - "description": "REQUIRED. GeocodeJSON result is a FeatureCollection." - }, - "geocoding": { + "$defs": { + "FeatureCollectionGeocoding": { "type": "object", - "description": "REQUIRED. Namespace.", "properties": { - "version": { - "type": "string", - "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", - "description": "REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.", - "examples": [ - "0.1.0", - "1.0.0-beta1", - "2.2.4" - ] - }, - "licence": { - "type": "string", - "description": "OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.", - "examples": [ - "ODbL" - ] + "type": { + "const": "FeatureCollection", + "description": "REQUIRED. GeocodeJSON result is a FeatureCollection." }, - "attribution": { - "type": "string", - "description": "OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.", - "examples": [ - "OpenStreetMap Contributors" - ] - }, - "query": { - "type": "string", - "description": "OPTIONAL. Default: null. The query that has been issued to trigger the search.", - "examples": [ - "24 allée de Bercy 75012 Paris" + "geocoding": { + "type": "object", + "description": "REQUIRED. Namespace.", + "properties": { + "version": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "minLength": 5, + "maxLength": 256, + "description": "REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.", + "examples": [ + "0.1.0", + "1.0.0-beta1", + "2.2.4" + ] + }, + "licence": { + "type": "string", + "description": "OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.", + "examples": [ + "ODbL" + ] + }, + "attribution": { + "type": "string", + "description": "OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.", + "examples": [ + "OpenStreetMap Contributors" + ] + }, + "query": { + "type": "string", + "description": "OPTIONAL. Default: null. The query that has been issued to trigger the search.", + "examples": [ + "24 allée de Bercy 75012 Paris" + ] + } + }, + "required": [ + "version" ] } }, "required": [ - "version" + "geocoding" ] }, - "features": { - "type": "array", - "description": "REQUIRED. As per GeoJSON spec.", - "items": { - "type": "object", - "description": "OPTIONAL. An array of feature objects.", - "properties": { - "type": { - "const": "Feature", - "description": "REQUIRED. As per GeoJSON spec." - }, - "properties": { + "FeatureGeocoding": { + "type": "object", + "properties": { + "features": { + "type": "array", + "description": "REQUIRED. As per GeoJSON spec.", + "items": { "type": "object", - "description": "REQUIRED. As per GeoJSON spec.", + "description": "OPTIONAL. An array of feature objects.", "properties": { - "geocoding": { + "type": { + "const": "Feature", + "description": "REQUIRED. As per GeoJSON spec." + }, + "properties": { "type": "object", - "description": "REQUIRED. Namespace.", + "description": "REQUIRED. As per GeoJSON spec.", "properties": { - "type": { - "type": "string", - "description": "REQUIRED. One of house, street, locality, city, region, country.", - "examples": [ - "house", - "street", - "district", - "city", - "county", - "state", - "country", - "locality" - ] - }, - "accuracy": { - "type": "number", - "minimum": 0, - "description": "OPTIONAL. Result accuracy, in meters.", - "examples": [ - 20 - ] - }, - "label": { - "type": "string", - "description": "RECOMMENDED. Suggested label for the result.", - "examples": [ - "My Shoes Shop, 64 rue de Metz 59280 Armentières" - ] - }, - "name": { - "type": "string", - "description": "OPTIONAL. Name of the place.", - "examples": [ - "My Shoes Shop" - ] - }, - "housenumber": { - "type": "string", - "description": "OPTIONAL. Housenumber of the place.", - "examples": [ - "64" - ] - }, - "street": { - "type": "string", - "description": "OPTIONAL. Street of the place.", - "examples": [ - "Rue de Metz" - ] - }, - "locality": { - "type": "string", - "description": "OPTIONAL. Locality of the place.", - "examples": [ - "Les Clarons" - ] - }, - "postcode": { - "type": "string", - "description": "OPTIONAL. Postcode of the place.", - "examples": [ - "59280" - ] - }, - "city": { - "type": "string", - "description": "OPTIONAL. City of the place.", - "examples": [ - "Armentières" - ] - }, - "district": { - "type": "string", - "description": "OPTIONAL. District of the place." - }, - "county": { - "type": "string", - "description": "OPTIONAL. County of the place." - }, - "state": { - "type": "string", - "description": "OPTIONAL. State of the place." - }, - "country": { - "type": "string", - "description": "OPTIONAL. Country of the place.", - "examples": [ - "France" - ] - }, - "admin": { + "geocoding": { "type": "object", - "description": "OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.", - "patternProperties": { - "^level[0-9]+": { - "type": "string" + "description": "REQUIRED. Namespace.", + "properties": { + "type": { + "type": "string", + "description": "REQUIRED. One of house, street, locality, city, region, country.", + "examples": [ + "house", + "street", + "district", + "city", + "county", + "state", + "country", + "locality" + ] + }, + "accuracy": { + "type": "number", + "minimum": 0, + "description": "OPTIONAL. Result accuracy, in meters.", + "examples": [ + 20 + ] + }, + "label": { + "type": "string", + "description": "RECOMMENDED. Suggested label for the result.", + "examples": [ + "My Shoes Shop, 64 rue de Metz 59280 Armentières" + ] + }, + "name": { + "type": "string", + "description": "OPTIONAL. Name of the place.", + "examples": [ + "My Shoes Shop" + ] + }, + "housenumber": { + "type": "string", + "description": "OPTIONAL. Housenumber of the place.", + "examples": [ + "64" + ] + }, + "street": { + "type": "string", + "description": "OPTIONAL. Street of the place.", + "examples": [ + "Rue de Metz" + ] + }, + "locality": { + "type": "string", + "description": "OPTIONAL. Locality of the place.", + "examples": [ + "Les Clarons" + ] + }, + "postcode": { + "type": "string", + "description": "OPTIONAL. Postcode of the place.", + "examples": [ + "59280" + ] + }, + "city": { + "type": "string", + "description": "OPTIONAL. City of the place.", + "examples": [ + "Armentières" + ] + }, + "district": { + "type": "string", + "description": "OPTIONAL. District of the place." + }, + "county": { + "type": "string", + "description": "OPTIONAL. County of the place." + }, + "state": { + "type": "string", + "description": "OPTIONAL. State of the place." + }, + "country": { + "type": "string", + "description": "OPTIONAL. Country of the place.", + "examples": [ + "France" + ] + }, + "admin": { + "type": "object", + "description": "OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.", + "patternProperties": { + "^level[0-9]+$": { + "type": "string" + } + } + }, + "geohash": { + "type": "string", + "pattern": "^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$", + "description": "OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).", + "examples": [ + "6gkzmg1w", + "6gkzwgjzn820", + "c216ne:Mt_Hood" + ] } - } - }, - "geohash": { - "type": "string", - "pattern": "^[a-zA-Z0-9]+(:.+)?$", - "description": "OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html).", - "examples": [ - "Ehugh5oofiToh9aWe3heemu7ighee8" + }, + "required": [ + "type" ] } }, "required": [ - "type" + "geocoding" ] } - }, - "required": [ - "geocoding" - ] + } } } } } - }, - "required": [ - "geocoding" - ] + } } \ No newline at end of file From eca16c989efd4ea8f0026e05a558e38a6cfc9041 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Tue, 10 Oct 2023 09:31:15 +0200 Subject: [PATCH 3/7] Fix typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37000d8..96ad598 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ Please verify the integrity of the JSON schema using the SHA-512 checksum provid ## How to contribute -Pre-requisites: [git](https://git-scm.com/), [make](https://www.gnu.org/software/make/), shasum [npx](https://www.npmjs.com/package/npx) (node and npm). +Pre-requisites: [git](https://git-scm.com/), [make](https://www.gnu.org/software/make/), [shasum](https://www.commandlinux.com/man-page/man1/shasum.1.html), [npx](https://www.npmjs.com/package/npx) (node and npm). Please follow these steps: -- Let the community knows you want to contibute opening an issue +- Let the community knows you want to contribute opening an issue - Fork this repo, clone it locally and create a new branch - Install git hooks running `make hooks` - Extend the [draft document]((https://github.com/jenkin/geocodejson-spec/blob/master/draft/README.md)) From 78e96363afa78ca019117e449297befb34cdd8e2 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Tue, 10 Oct 2023 11:20:32 +0200 Subject: [PATCH 4/7] Move out semver and geohash schema and refactor --- draft/geocodejson.schema.json | 2 +- draft/geocodejson.schema.json.checksum | 2 +- src/geocodejson.schema.json | 34 ++++---------------------- src/geohash.schema.json | 12 +++++++++ src/semver.schema.json | 15 ++++++++++++ 5 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 src/geohash.schema.json create mode 100644 src/semver.schema.json diff --git a/draft/geocodejson.schema.json b/draft/geocodejson.schema.json index a26b0f6..fb563e1 100644 --- a/draft/geocodejson.schema.json +++ b/draft/geocodejson.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}],"$defs":{"FeatureCollectionGeocoding":{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","examples":["0.1.0","1.0.0-beta1","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},"FeatureGeocoding":{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}}} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://semver.org/semver.schema.json","type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"A semver.org compliant version number (see https://semver.org).","examples":["0.1.0","1.0.0-beta.1","1.0.0-0.3.7","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://geohash.org/geohash.schema.json","type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}]} \ No newline at end of file diff --git a/draft/geocodejson.schema.json.checksum b/draft/geocodejson.schema.json.checksum index 71c019b..1e72e98 100644 --- a/draft/geocodejson.schema.json.checksum +++ b/draft/geocodejson.schema.json.checksum @@ -1 +1 @@ -sha512-b89618c2ff62349d13d1e3dfeffa6243a6e102ce7c4eb11c6b214440cdbc5da7cc2c5d02573dcbb73fb0eabb368c5f065221039cb48527443be0c54a0b2cbccb \ No newline at end of file +sha512-3c8080abf50e954afc58551c5fe396db01f09489c1162b76de9381a16b580cccc22afb568d7f26696e044f3a54b1a4edd9e00198108f24934a68a7ee4b09d3f1 \ No newline at end of file diff --git a/src/geocodejson.schema.json b/src/geocodejson.schema.json index fbc4b22..ed08fb9 100644 --- a/src/geocodejson.schema.json +++ b/src/geocodejson.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://sparkfabrik.github.io/nominatim-openapi/geocodejson.schema.json", + "$id": "https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json", "title": "GeocodeJSON Schema", "description": "GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.", "allOf": [ @@ -8,14 +8,6 @@ "$ref": "https://geojson.org/schema/GeoJSON.json" }, { - "$ref": "#/$defs/FeatureCollectionGeocoding" - }, - { - "$ref": "#/$defs/FeatureGeocoding" - } - ], - "$defs": { - "FeatureCollectionGeocoding": { "type": "object", "properties": { "type": { @@ -27,16 +19,7 @@ "description": "REQUIRED. Namespace.", "properties": { "version": { - "type": "string", - "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", - "minLength": 5, - "maxLength": 256, - "description": "REQUIRED. A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.", - "examples": [ - "0.1.0", - "1.0.0-beta1", - "2.2.4" - ] + "$ref": "semver.schema.json" }, "licence": { "type": "string", @@ -69,7 +52,7 @@ "geocoding" ] }, - "FeatureGeocoding": { + { "type": "object", "properties": { "features": { @@ -191,14 +174,7 @@ } }, "geohash": { - "type": "string", - "pattern": "^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$", - "description": "OPTIONAL. Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).", - "examples": [ - "6gkzmg1w", - "6gkzwgjzn820", - "c216ne:Mt_Hood" - ] + "$ref": "geohash.schema.json" } }, "required": [ @@ -215,5 +191,5 @@ } } } - } + ] } \ No newline at end of file diff --git a/src/geohash.schema.json b/src/geohash.schema.json new file mode 100644 index 0000000..b1b94f5 --- /dev/null +++ b/src/geohash.schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://geohash.org/geohash.schema.json", + "type": "string", + "pattern": "^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$", + "description": "Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).", + "examples": [ + "6gkzmg1w", + "6gkzwgjzn820", + "c216ne:Mt_Hood" + ] +} \ No newline at end of file diff --git a/src/semver.schema.json b/src/semver.schema.json new file mode 100644 index 0000000..cc05c06 --- /dev/null +++ b/src/semver.schema.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://semver.org/semver.schema.json", + "type": "string", + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", + "minLength": 5, + "maxLength": 256, + "description": "A semver.org compliant version number (see https://semver.org).", + "examples": [ + "0.1.0", + "1.0.0-beta.1", + "1.0.0-0.3.7", + "2.2.4" + ] +} \ No newline at end of file From 5fb23077af4b770b9abf4e778c2810b6342b0ad0 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Tue, 10 Oct 2023 16:44:27 +0200 Subject: [PATCH 5/7] Add some descriptions --- README.md | 4 ++++ draft/geocodejson.schema.json | 2 +- draft/geocodejson.schema.json.checksum | 2 +- src/geocodejson.schema.json | 16 ++++++++++------ src/geohash.schema.json | 2 +- src/semver.schema.json | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 96ad598..4c66409 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,7 @@ Please follow these steps: - Run `make build` - If all is ok, commit your changes and push them - Open a Pull Request on the main branch of this repo + +## Licence + +Public Domain, No Rights Reserved - Creative Commons Zero License ([CC0](https://creativecommons.org/public-domain/cc0/)). diff --git a/draft/geocodejson.schema.json b/draft/geocodejson.schema.json index fb563e1..8a1b292 100644 --- a/draft/geocodejson.schema.json +++ b/draft/geocodejson.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://semver.org/semver.schema.json","type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"description":"A semver.org compliant version number (see https://semver.org).","examples":["0.1.0","1.0.0-beta.1","1.0.0-0.3.7","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. Default: null. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://geohash.org/geohash.schema.json","type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","description":"Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}]} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json","title":"GeocodeJSON Schema","description":"GeocodeJSON is an extension of the GeoJSON format and it is an attempt to create a standard for handling geocoding results.","allOf":[{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://geojson.org/schema/GeoJSON.json","title":"GeoJSON","oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON FeatureCollection","type":"object","required":["type","features"],"properties":{"type":{"type":"string","enum":["FeatureCollection"]},"features":{"type":"array","items":{"title":"GeoJSON Feature","type":"object","required":["type","properties","geometry"],"properties":{"type":{"type":"string","enum":["Feature"]},"id":{"oneOf":[{"type":"number"},{"type":"string"}]},"properties":{"oneOf":[{"type":"null"},{"type":"object"}]},"geometry":{"oneOf":[{"type":"null"},{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON GeometryCollection","type":"object","required":["type","geometries"],"properties":{"type":{"type":"string","enum":["GeometryCollection"]},"geometries":{"type":"array","items":{"oneOf":[{"title":"GeoJSON Point","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"number"}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON LineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["LineString"]},"coordinates":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON Polygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Polygon"]},"coordinates":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPoint","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPoint"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"number"}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiLineString","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiLineString"]},"coordinates":{"type":"array","items":{"type":"array","minItems":2,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}},{"title":"GeoJSON MultiPolygon","type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["MultiPolygon"]},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"array","minItems":4,"items":{"type":"array","minItems":2,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}},"bbox":{"type":"array","minItems":4,"items":{"type":"number"}}}}]},{"type":"object","description":"GeocodeJSON extension of GeoJSON Feature Collection","properties":{"type":{"const":"FeatureCollection","description":"REQUIRED. GeocodeJSON result is a FeatureCollection."},"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"version":{"description":"A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance.","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://semver.org/semver.schema.json","type":"string","pattern":"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$","minLength":5,"maxLength":256,"examples":["0.1.0","1.0.0-beta.1","1.0.0-0.3.7","2.2.4"]},"licence":{"type":"string","description":"OPTIONAL. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.","examples":["ODbL"]},"attribution":{"type":"string","description":"OPTIONAL. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.","examples":["OpenStreetMap Contributors"]},"query":{"type":"string","description":"OPTIONAL. The query that has been issued to trigger the search.","examples":["24 allée de Bercy 75012 Paris"]}},"required":["version"]}},"required":["geocoding"]},{"type":"object","description":"GeocodeJSON extension of GeoJSON Feature","properties":{"features":{"type":"array","description":"REQUIRED. As per GeoJSON spec.","items":{"type":"object","description":"OPTIONAL. An array of feature objects.","properties":{"type":{"const":"Feature","description":"REQUIRED. As per GeoJSON spec."},"properties":{"type":"object","description":"REQUIRED. As per GeoJSON spec.","properties":{"geocoding":{"type":"object","description":"REQUIRED. Namespace.","properties":{"type":{"type":"string","description":"REQUIRED. One of house, street, locality, city, region, country.","examples":["house","street","district","city","county","state","country","locality"]},"accuracy":{"type":"number","minimum":0,"description":"OPTIONAL. Result accuracy, in meters.","examples":[20]},"label":{"type":"string","description":"RECOMMENDED. Suggested label for the result.","examples":["My Shoes Shop, 64 rue de Metz 59280 Armentières"]},"name":{"type":"string","description":"OPTIONAL. Name of the place.","examples":["My Shoes Shop"]},"housenumber":{"type":"string","description":"OPTIONAL. Housenumber of the place.","examples":["64"]},"street":{"type":"string","description":"OPTIONAL. Street of the place.","examples":["Rue de Metz"]},"locality":{"type":"string","description":"OPTIONAL. Locality of the place.","examples":["Les Clarons"]},"postcode":{"type":"string","description":"OPTIONAL. Postcode of the place.","examples":["59280"]},"city":{"type":"string","description":"OPTIONAL. City of the place.","examples":["Armentières"]},"district":{"type":"string","description":"OPTIONAL. District of the place."},"county":{"type":"string","description":"OPTIONAL. County of the place."},"state":{"type":"string","description":"OPTIONAL. State of the place."},"country":{"type":"string","description":"OPTIONAL. Country of the place.","examples":["France"]},"admin":{"type":"object","description":"OPTIONAL. Administratives boundaries the feature is included in, as defined in http://wiki.osm.org/wiki/Key:admin_level#admin_level.","patternProperties":{"^level[0-9]+$":{"type":"string"}}},"geohash":{"description":"OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html).","$schema":"http://json-schema.org/draft-07/schema#","$id":"http://geohash.org/geohash.schema.json","type":"string","pattern":"^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$","examples":["6gkzmg1w","6gkzwgjzn820","c216ne:Mt_Hood"]}},"required":["type"]}},"required":["geocoding"]}}}}}}]} \ No newline at end of file diff --git a/draft/geocodejson.schema.json.checksum b/draft/geocodejson.schema.json.checksum index 1e72e98..62250e2 100644 --- a/draft/geocodejson.schema.json.checksum +++ b/draft/geocodejson.schema.json.checksum @@ -1 +1 @@ -sha512-3c8080abf50e954afc58551c5fe396db01f09489c1162b76de9381a16b580cccc22afb568d7f26696e044f3a54b1a4edd9e00198108f24934a68a7ee4b09d3f1 \ No newline at end of file +sha512-9205cc1f149fe92799841a54e917e434d481404b9ccafed032b332b4bb3c5089619d64d66e3b277e3e542d8fe09752e6f30e825e5be45a2c25cb136625c86ff7 \ No newline at end of file diff --git a/src/geocodejson.schema.json b/src/geocodejson.schema.json index ed08fb9..837893a 100644 --- a/src/geocodejson.schema.json +++ b/src/geocodejson.schema.json @@ -2,13 +2,14 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://geocoders.github.io/geocodejson-spec/draft/geocodejson.schema.json", "title": "GeocodeJSON Schema", - "description": "GeocodeJSON is an extension of the GeoJSON standard that aim to handle results from geocoding services.", + "description": "GeocodeJSON is an extension of the GeoJSON format and it is an attempt to create a standard for handling geocoding results.", "allOf": [ { "$ref": "https://geojson.org/schema/GeoJSON.json" }, { "type": "object", + "description": "GeocodeJSON extension of GeoJSON Feature Collection", "properties": { "type": { "const": "FeatureCollection", @@ -19,25 +20,26 @@ "description": "REQUIRED. Namespace.", "properties": { "version": { - "$ref": "semver.schema.json" + "$ref": "semver.schema.json", + "description": "A semver.org compliant version number. Describes the version of the GeocodeJSON spec that is implemented by this instance." }, "licence": { "type": "string", - "description": "OPTIONAL. Default: null. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.", + "description": "OPTIONAL. The licence of the data. In case of multiple sources, and then multiple licences, can be an object with one key by source.", "examples": [ "ODbL" ] }, "attribution": { "type": "string", - "description": "OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.", + "description": "OPTIONAL. The attribution of the data. In case of multiple sources, and then multiple attributions, can be an object with one key by source.", "examples": [ "OpenStreetMap Contributors" ] }, "query": { "type": "string", - "description": "OPTIONAL. Default: null. The query that has been issued to trigger the search.", + "description": "OPTIONAL. The query that has been issued to trigger the search.", "examples": [ "24 allée de Bercy 75012 Paris" ] @@ -54,6 +56,7 @@ }, { "type": "object", + "description": "GeocodeJSON extension of GeoJSON Feature", "properties": { "features": { "type": "array", @@ -174,7 +177,8 @@ } }, "geohash": { - "$ref": "geohash.schema.json" + "$ref": "geohash.schema.json", + "description": "OPTIONAL. Geohash encoding of coordinates (see http://geohash.org/site/tips.html)." } }, "required": [ diff --git a/src/geohash.schema.json b/src/geohash.schema.json index b1b94f5..b0b1288 100644 --- a/src/geohash.schema.json +++ b/src/geohash.schema.json @@ -2,8 +2,8 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://geohash.org/geohash.schema.json", "type": "string", - "pattern": "^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$", "description": "Geohash encoding of coordinates (see http://geohash.org and https://en.wikipedia.org/wiki/Geohash).", + "pattern": "^[0123456789bcdefghjkmnpqrstuvwxyz]+(:.+)?$", "examples": [ "6gkzmg1w", "6gkzwgjzn820", diff --git a/src/semver.schema.json b/src/semver.schema.json index cc05c06..7322751 100644 --- a/src/semver.schema.json +++ b/src/semver.schema.json @@ -2,10 +2,10 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://semver.org/semver.schema.json", "type": "string", + "description": "A semver.org compliant version number (see https://semver.org).", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$", "minLength": 5, "maxLength": 256, - "description": "A semver.org compliant version number (see https://semver.org).", "examples": [ "0.1.0", "1.0.0-beta.1", From b72123bbf9750e88c68127b39cb08c7d15b1abb9 Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Tue, 10 Oct 2023 16:57:36 +0200 Subject: [PATCH 6/7] Fix links in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4c66409..8e3496b 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ An attempt to have standard geojson responses from geocoders. ## How to use -Please read the full spec at [master/draft/README.md](https://github.com/jenkin/geocodejson-spec/blob/master/draft/README.md). +Please read the full spec at [master/draft/README.md](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md). -You can validate a geocoding service response against this GeocodeJSON spec using the JSON schema provided: [master/draft/geocodejson.schema.json](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json). Refer to [JSON Schema official website](https://json-schema.org/) for further informations. +You can validate a geocoding service response against this GeocodeJSON spec using the JSON schema provided: [master/draft/geocodejson.schema.json](https://github.com/geocoders/geocodejson-spec/blob/master/draft/geocodejson.schema.json). Refer to [JSON Schema official website](https://json-schema.org/) for further informations. -Please verify the integrity of the JSON schema using the SHA-512 checksum provided: [master/draft/geocodejson.schema.json.checksum](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json.checksum). +Please verify the integrity of the JSON schema using the SHA-512 checksum provided: [master/draft/geocodejson.schema.json.checksum](https://github.com/geocoders/geocodejson-spec/blob/master/draft/geocodejson.schema.json.checksum). ## How to contribute @@ -19,8 +19,8 @@ Please follow these steps: - Let the community knows you want to contribute opening an issue - Fork this repo, clone it locally and create a new branch - Install git hooks running `make hooks` -- Extend the [draft document]((https://github.com/jenkin/geocodejson-spec/blob/master/draft/README.md)) -- Update the [JSON schema](https://github.com/jenkin/geocodejson-spec/blob/master/draft/geocodejson.schema.json) in `src/` folder +- Extend the [draft document]((https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md)) +- Update the [JSON schema](https://github.com/geocoders/geocodejson-spec/blob/master/draft/geocodejson.schema.json) in `src/` folder - Run `make build` - If all is ok, commit your changes and push them - Open a Pull Request on the main branch of this repo From c08e5c19e1b8e8ea130b612061f16a608ba3f0ed Mon Sep 17 00:00:00 2001 From: Alessio Cimarelli Date: Wed, 11 Oct 2023 11:06:32 +0200 Subject: [PATCH 7/7] Remove git hooks --- Makefile | 24 ++++++++++-------------- README.md | 7 +++---- .githooks/pre-commit => scripts/checksum | 0 .githooks/pre-push => scripts/verify | 0 4 files changed, 13 insertions(+), 18 deletions(-) rename .githooks/pre-commit => scripts/checksum (100%) rename .githooks/pre-push => scripts/verify (100%) diff --git a/Makefile b/Makefile index 3ff67d8..fdbf315 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,19 @@ AJV_CLI_VERSION ?= 5.0.0 JSON_DEREFERENCE_CLI_VERSION ?= 0.1.2 -hooks: - echo "Installing git hooks" - cp .githooks/* .git/hooks/ +all: build validate checksum verify -checksum: - echo "Computing spec checksum" - .githooks/pre-commit - -verify: - .githooks/pre-push && echo "Checksum ok" - -bundle: - echo "Building spec bundle" +build: + @echo "Building spec bundle" npx -y json-dereference-cli@$(JSON_DEREFERENCE_CLI_VERSION) -s src/geocodejson.schema.json -o draft/geocodejson.schema.json validate: - echo "Validating spec bundle" + @echo "Validating spec bundle" npx -y ajv-cli@$(AJV_CLI_VERSION) compile -s draft/geocodejson.schema.json -build: bundle validate checksum verify +checksum: + @echo "Computing spec checksum" + ./scripts/checksum + +verify: + ./scripts/verify && echo "Checksum ok" diff --git a/README.md b/README.md index 8e3496b..391a1dc 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,11 @@ Pre-requisites: [git](https://git-scm.com/), [make](https://www.gnu.org/software Please follow these steps: -- Let the community knows you want to contribute opening an issue +- Let the community knows you want to contribute [opening an issue](https://github.com/geocoders/geocodejson-spec/issues) - Fork this repo, clone it locally and create a new branch -- Install git hooks running `make hooks` -- Extend the [draft document]((https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md)) +- Edit the [draft document]((https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md)) - Update the [JSON schema](https://github.com/geocoders/geocodejson-spec/blob/master/draft/geocodejson.schema.json) in `src/` folder -- Run `make build` +- Run `make` - If all is ok, commit your changes and push them - Open a Pull Request on the main branch of this repo diff --git a/.githooks/pre-commit b/scripts/checksum similarity index 100% rename from .githooks/pre-commit rename to scripts/checksum diff --git a/.githooks/pre-push b/scripts/verify similarity index 100% rename from .githooks/pre-push rename to scripts/verify