diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-02-12 16:44:15 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-02-12 16:44:15 +0100 |
commit | a1704a27055df09c41700f60d5293ec68c0c1d4c (patch) | |
tree | 710e59436d21fc9eeea29928e41bf483dd93d319 /src/hydrilla/server | |
parent | 40c24168fcaf9251f56e8570538e9a7dd48795e9 (diff) | |
download | haketilo-hydrilla-a1704a27055df09c41700f60d5293ec68c0c1d4c.tar.gz haketilo-hydrilla-a1704a27055df09c41700f60d5293ec68c0c1d4c.zip |
when generating JSON documents, put generating software info in 'generated_by' property
Diffstat (limited to 'src/hydrilla/server')
-rw-r--r-- | src/hydrilla/server/serve.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/hydrilla/server/serve.py b/src/hydrilla/server/serve.py index 6cfceaa..8a2b3a5 100644 --- a/src/hydrilla/server/serve.py +++ b/src/hydrilla/server/serve.py @@ -42,9 +42,15 @@ from werkzeug import Response from .. import util from . import config +from . import _version here = Path(__file__).resolve().parent +generated_by = { + 'name': 'hydrilla.server', + 'version': _version.version +} + class ItemInfo(ABC): """Shortened data of a resource/mapping.""" def __init__(self, item_obj: dict): @@ -532,10 +538,8 @@ def query(): mapping_refs = [i.as_query_result() for i in malcontent().query(url)] result = { 'api_schema_version': [1], - 'generated_by': { - 'name': 'hydrilla' - }, - 'mappings': mapping_refs + 'mappings': mapping_refs, + 'generated_by': generated_by } return json.dumps(result) |