Skip to content

RFC7: add support for validator plugins - #2396

Merged
tomkralidis merged 2 commits into
masterfrom
validation
Aug 18, 2026
Merged

tomkralidis merged 2 commits into
masterfrom
validation

Conversation

@tomkralidis

@tomkralidis tomkralidis commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

Overview

This PR implements RFC7, adding support for validation plugin facilities in support of data validation on item transactions.

Related Issue / discussion

Additional information

RFC7: https://pygeoapi.io/development/rfc/7

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi wilxl be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

@tomkralidis tomkralidis added this to the 0.25.0 milestone Aug 4, 2026
@tomkralidis tomkralidis added enhancement New feature or request OGC API - Features OGC API - Features OGC API - Records OGC API - Records labels Aug 4, 2026
@tomkralidis
tomkralidis force-pushed the validation branch 4 times, most recently from e78f1a5 to 535cfa7 Compare August 4, 2026 15:22
@tomkralidis tomkralidis changed the title [WIP] add support for validator plugins RFC7: add support for validator plugins Aug 5, 2026
@tomkralidis
tomkralidis requested a review from a team August 7, 2026 11:20
@tomkralidis
tomkralidis force-pushed the validation branch 2 times, most recently from 75693fb to d94a27f Compare August 10, 2026 02:27

@justb4 justb4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very useful addition. What I don't understand: in the configuration example a Python Module path is specified like name: path.to.validator. But in plugin.py a name: Python path is defined like:

'validator': {
        'GeoJSON': 'pygeoapi.validator.geojson.GeoJSONValidator'

Maybe I did not understand, or is the idea one can also refer by name, like GeoJSON, to a pre-configured validator in plugin.py?

@tomkralidis

Copy link
Copy Markdown
Member Author

Very useful addition. What I don't understand: in the configuration example a Python Module path is specified like name: path.to.validator. But in plugin.py a name: Python path is defined like:

'validator': {
        'GeoJSON': 'pygeoapi.validator.geojson.GeoJSONValidator'

Maybe I did not understand, or is the idea one can also refer by name, like GeoJSON, to a pre-configured validator in plugin.py?

Yes, validators that are shipped "on board" with pygeoapi can be referrred to by a shortname (i.e. GeoJSON), which evaluates to the dotted path, in configuration. Configuration can also explicitly point to a dotted path just the same; the result of both approaches is a dotted path/class that is instantiated accordingly.

@justb4

justb4 commented Aug 10, 2026

Copy link
Copy Markdown
Member

Very useful addition. What I don't understand: in the configuration example a Python Module path is specified like name: path.to.validator. But in plugin.py a name: Python path is defined like:

'validator': {
        'GeoJSON': 'pygeoapi.validator.geojson.GeoJSONValidator'

Maybe I did not understand, or is the idea one can also refer by name, like GeoJSON, to a pre-configured validator in plugin.py?

Yes, validators that are shipped "on board" with pygeoapi can be referrred to by a shortname (i.e. GeoJSON), which evaluates to the dotted path, in configuration. Configuration can also explicitly point to a dotted path just the same; the result of both approaches is a dotted path/class that is instantiated accordingly.

Ok, suggestion to add this to the documentation, which only mentions/suggests "module path".

@tomkralidis

Copy link
Copy Markdown
Member Author

Very useful addition. What I don't understand: in the configuration example a Python Module path is specified like name: path.to.validator. But in plugin.py a name: Python path is defined like:

'validator': {
        'GeoJSON': 'pygeoapi.validator.geojson.GeoJSONValidator'

Maybe I did not understand, or is the idea one can also refer by name, like GeoJSON, to a pre-configured validator in plugin.py?

Yes, validators that are shipped "on board" with pygeoapi can be referrred to by a shortname (i.e. GeoJSON), which evaluates to the dotted path, in configuration. Configuration can also explicitly point to a dotted path just the same; the result of both approaches is a dotted path/class that is instantiated accordingly.

Ok, suggestion to add this to the documentation, which only mentions/suggests "module path".

+1, docs updated.

Comment thread pygeoapi/api/itemtypes.py
Comment thread pygeoapi/api/itemtypes.py Outdated
Comment thread pygeoapi/api/itemtypes.py Outdated
Comment thread pygeoapi/api/itemtypes.py
Comment thread docs/source/transactions.rst Outdated
Comment thread docs/source/configuration.rst
Comment thread pygeoapi/validator/geojson.py
Comment thread tests/validator/test_geojson_validator.py
Comment thread pygeoapi/validator/base.py Outdated
Comment thread pygeoapi/validator/base.py Outdated
Comment thread pygeoapi/validator/geojson.py Outdated
Comment thread docs/source/plugins.rst Outdated
Comment thread docs/source/plugins.rst Outdated
Comment thread pygeoapi/validator/base.py Outdated
Comment thread pygeoapi/validator/base.py Outdated
Comment thread pygeoapi/validator/geojson.py
@tomkralidis

Copy link
Copy Markdown
Member Author

Merging given RFC7 vote and PR approval. Thanks for the valuable feedback and comment!

@tomkralidis
tomkralidis merged commit 84090fb into master Aug 18, 2026
11 checks passed
@tomkralidis
tomkralidis deleted the validation branch August 18, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request OGC API - Features OGC API - Features OGC API - Records OGC API - Records

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants