add geometry to queryables (#755)

This commit is contained in:
Tom Kralidis
2021-08-22 08:28:56 -04:00
committed by GitHub
parent 9d920901b5
commit bc97ed480a
2 changed files with 10 additions and 3 deletions
+5 -1
View File
@@ -1109,7 +1109,11 @@ class API:
'type': 'object',
'title': l10n.translate(
self.config['resources'][dataset]['title'], request.locale),
'properties': {},
'properties': {
'geometry': {
'$ref': 'https://geojson.org/schema/Geometry.json'
}
},
'$schema': 'http://json-schema.org/draft/2019-09/schema',
'$id': '{}/collections/{}/queryables'.format(
self.config['server']['url'], dataset)
+5 -2
View File
@@ -400,7 +400,7 @@ def test_get_collection_queryables(config, api_):
queryables = json.loads(response)
assert 'properties' in queryables
assert len(queryables['properties']) == 6
assert len(queryables['properties']) == 7
# test with provider filtered properties
api_.config['resources']['obs']['providers'][0]['properties'] = ['stn_id']
@@ -409,7 +409,10 @@ def test_get_collection_queryables(config, api_):
queryables = json.loads(response)
assert 'properties' in queryables
assert len(queryables['properties']) == 1
assert len(queryables['properties']) == 2
assert 'geometry' in queryables['properties']
assert queryables['properties']['geometry']['$ref'] == 'https://geojson.org/schema/Geometry.json' # noqa
# No language requested: should be set to default from YAML
assert rsp_headers['Content-Language'] == 'en-US'