From f94ad370e39b24b48429bc843ad6733cec6cd424 Mon Sep 17 00:00:00 2001 From: Benjamin Webb <40066515+webb-ben@users.noreply.github.com> Date: Wed, 3 Apr 2024 06:39:00 -0400 Subject: [PATCH] Safely serialize configuration JSON (#1605) * Safely serialize configuration JSON Co-Authored-By: Tom Kralidis * Revert "Safely serialize configuration JSON" This reverts commit 36feb067ee6f87e61955852dc48994f075806370. * Add test for datetime with Admin API * Safely serialize configuration JSON --------- Co-authored-by: Tom Kralidis --- pygeoapi/admin.py | 4 ++-- tests/data/admin/resource-post.json | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pygeoapi/admin.py b/pygeoapi/admin.py index ff98b611f..215414408 100644 --- a/pygeoapi/admin.py +++ b/pygeoapi/admin.py @@ -128,8 +128,8 @@ def write_config(self, config): # Preserve env variables LOGGER.debug('Reading env variables in configuration') - raw_conf = get_config(raw=True) - conf = get_config() + raw_conf = json.loads(to_json(get_config(raw=True))) + conf = json.loads(to_json(get_config())) patch = make_patch(conf, raw_conf) LOGGER.debug('Merging env variables') diff --git a/tests/data/admin/resource-post.json b/tests/data/admin/resource-post.json index 031d8d76e..fb7804da1 100644 --- a/tests/data/admin/resource-post.json +++ b/tests/data/admin/resource-post.json @@ -32,6 +32,9 @@ 90 ], "crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + }, + "temporal": { + "begin": "2018-02-14T11:11:11Z" } }, "providers": [