You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/data-publishing/ogcapi-features.rst
+35-2Lines changed: 35 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ parameters.
39
39
.. note::
40
40
41
41
* All Providers that support `bbox` also support the `bbox-crs` parameter. `bbox-crs` is handled within pygeoapi core.
42
-
* All Providers support the `crs` parameter to reproject (transform) response data. Some, like PostgreSQL and OGR, perform this natively: '✅n'.
42
+
* All Providers support the `crs` parameter to reproject (transform) response data. Some, like PostgreSQL and OGR, perform this natively.
43
43
44
44
45
45
Connection examples
@@ -558,12 +558,19 @@ The ``ORACLE_POOL_MIN`` and ``ORACLE_POOL_MAX`` environment variables are used t
558
558
If none or only one of the environment variables is set, session pooling will not be activated and standalone connections are established at every request.
559
559
560
560
561
+
Extra_params
562
+
""""""""""""
563
+
The Oracle provider allows for additional parameters that can be passed in the request. It allows for the processing of additional parameters that are not defined in the ``pygeoapi-config.yml`` to be passed to a custom SQL-Manipulator-Plugin. An example use case of this is advanced filtering without exposing the filtered columns like follows ``.../collections/some_data/items?is_recent=true``. The ``SqlManipulator`` plugin's ``process_query`` method would receive ``extra_params = {'is_recent': 'true'}`` and could dynamically add a custom condition to the SQL query, like ``AND SYSDATE - create_date < 30``.
564
+
565
+
The ``include_extra_query_parameters`` has to be set to ``true`` for the collection in ``pygeoapi-config.yml``. This ensures that the additional request parameters (e.g. ``is_recent=true``) are not discarded.
566
+
567
+
561
568
Custom SQL Manipulator Plugin
562
569
"""""""""""""""""""""""""""""
563
570
The provider supports a SQL-Manipulator-Plugin class. With this, the SQL statement could be manipulated. This is
564
571
useful e.g. for authorization at row level or manipulation of the explain plan with hints.
565
572
566
-
An example an more information about that feature you can find in the test class in tests/test_oracle_provider.py.
573
+
More information and examples about this feature can be found in ``tests/provider/test_oracle_provider.py``.
567
574
568
575
.. _Parquet:
569
576
@@ -804,6 +811,32 @@ To publish a TinyDB (`see website <https://tinydb.readthedocs.io>`_) index, the
804
811
id_field: identifier
805
812
time_field: datetimefield
806
813
814
+
.. _including-extra-query-parameters:
815
+
816
+
Including extra query parameters
817
+
--------------------------------
818
+
819
+
By default, pygeoapi ignores any extra query parameters. For example, for a given ``.../items`` query, the query key-value pair ``foo1=bar1`` (if ``foo1`` is not a valid property of a given collection) would be ignored by pygeoapi as well as the underlying provider.
820
+
821
+
To include/accept extra query parameters, the ``include_extra_query_parameters`` directive can be set in provider configuration:
822
+
823
+
.. code-block:: yaml
824
+
825
+
providers:
826
+
- type: feature
827
+
editable: true|false # optional, default is false
828
+
name: TinyDB
829
+
data: /path/to/file.db
830
+
id_field: identifier
831
+
time_field: datetimefield
832
+
include_extra_query_parameters: true
833
+
834
+
835
+
With the above configuration, pygeoapi will pass ``foo1=bar1`` to the underlying provider. If the underlying provider does not have ``foo1`` as a queryable property, then an exception will be returned citing an unknown property.
836
+
837
+
Extra query parameters are useful for custom providers who may wish for specific functionality to be triggered by query parameters that are not bound to a given collection's properties.
0 commit comments