Skip to content

Commit

Permalink
Safely serialize configuration JSON (geopython#1605)
Browse files Browse the repository at this point in the history
* Safely serialize configuration JSON

Co-Authored-By: Tom Kralidis <tomkralidis@gmail.com>

* Revert "Safely serialize configuration JSON"

This reverts commit 36feb06.

* Add test for datetime with Admin API

* Safely serialize configuration JSON

---------

Co-authored-by: Tom Kralidis <tomkralidis@gmail.com>
  • Loading branch information
webb-ben and tomkralidis committed Apr 3, 2024
1 parent e72d4ba commit 122666c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygeoapi/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 3 additions & 0 deletions tests/data/admin/resource-post.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
90
],
"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"temporal": {
"begin": "2018-02-14T11:11:11Z"
}
},
"providers": [
Expand Down

0 comments on commit 122666c

Please sign in to comment.