diff --git a/docs/source/development.rst b/docs/source/development.rst index ed4a6e1..bf8e4d0 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -34,7 +34,7 @@ This workflow is valid only for the `CQL-JSON` format. Schema ^^^^^^ -The Common Query Language (CQL) is the part 3 of the standard OGC API - Features. This extension has its specification available at +The Common Query Language (CQL) is the part 3 of the standard OGC API - Features. This extension has its specification available at `OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) `_ and the schema exists in development at `cql.json `_. @@ -42,18 +42,22 @@ Model generation ^^^^^^^^^^^^^^^^ pygeoapi uses a class-based Python model interface to translate the schema into Python objects defined by `pydantic `_ models. -The model is generated with the pre-processing of the schema through the utility ``datamodel-codegen``: +The model is generated with the pre-processing of the schema through the utility ``datamodel-codegen``, which is part +of the `datamodel-code-generator `_ package: + .. code-block:: bash # Generate from local downloaded json schema file datamodel-codegen --input ~/Download/cql-schema.json --input-file-type jsonschema --output ./pygeoapi/models/cql_update.py --class-name CQLModel +Note that datamodel-code-generator must be explicitly installed, as it is not a pygeoapi runtime dependency + How to merge ^^^^^^^^^^^^ Once the new pydantic models have been generated then the content of the Python file ``cql_update.py`` can be used to replace the old classes within the ``cql.py`` file. -Update everything above the function ``get_next_node`` and then verify if the tests for the CQL are still passing, for example ``test_post_cql_json_between_query`` +Update everything above the function ``get_next_node`` and then verify if the tests for the CQL are still passing, for example ``test_post_cql_json_between_query`` in ``tests/test_elasticsearch__provider.py``. Working with Spatialite on OSX diff --git a/requirements-dev.txt b/requirements-dev.txt index 1b5bc81..c64b4a0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,6 @@ # Flask-based CORS setup flask_cors -# Generate pydantic models from json schema -datamodel-code-generator - # testing pytest pytest-cov