Coder Social home page Coder Social logo

Comments (5)

tomkralidis avatar tomkralidis commented on July 18, 2024

@1ly1mk can you provide a payload that I can use to reproduce? Thanks

from pygeoapi.

1ly1mk avatar 1ly1mk commented on July 18, 2024

@tomkralidis here is the payload for PATCH

{
      "metadata": {
        "identification": {
            "title": "pygeoapi  admin api test",
            "description": "pygeoapi provides an API to geospatial data",
            "keywords": [
                "geospatial",
                "data",
                "api"
            ],
            "keywords_type": "theme",
            "terms_of_service": "https://creativecommons.org/licenses/by/4.0/",
            "url": "http://example.org"
        },
        "license": {
            "name": "CC-BY 4.0 license",
            "url": "https://creativecommons.org/licenses/by/4.0/"
        },
        "provider": {
            "name": "Organization Name",
            "url": "https://pygeoapi.io"
        },
        "contact": {
            "name": "Lastname, Firstname",
            "position": "Position Title",
            "address": "Mailing Address",
            "city": "City",
            "stateorprovince": "Administrative Area",
            "postalcode": "Zip or Postal Code",
            "country": "Country",
            "phone": "+xx-xxx-xxx-xxxx",
            "fax": "+xx-xxx-xxx-xxxx",
            "email": "[email protected]",
            "url": "Contact URL",
            "hours": "Hours of Service",
            "instructions": "During hours of service.  Off on weekends.",
            "role": "pointOfContact"
        }
    }
}

from pygeoapi.

tomkralidis avatar tomkralidis commented on July 18, 2024

Looks like the existing YAML config that gets parsed into a dict preserves a native datetime value. We could write dates in YAML as literal strings, but that is assuming users are doing same. We could also "round trip" the YAML->dict->JSON->dict as follows:

diff --git a/pygeoapi/config.py b/pygeoapi/config.py
index d1bf5c3..f542325 100644
--- a/pygeoapi/config.py
+++ b/pygeoapi/config.py
@@ -59,7 +59,7 @@ def get_config(raw: bool = False) -> dict:
         else:
             CONFIG = yaml_load(fh)
 
-    return CONFIG
+    return json.loads(to_json(CONFIG))
 
 
 def load_schema() -> dict:

however this seems like extra hops/more moving parts.

cc'ing @webb-ben here for thoughts/input.

from pygeoapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.