Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support I/O schema field definition #245

Closed
7 tasks done
fmigneault opened this issue Apr 28, 2021 · 0 comments · Fixed by #429
Closed
7 tasks done

[Feature] Support I/O schema field definition #245

fmigneault opened this issue Apr 28, 2021 · 0 comments · Fixed by #429
Assignees
Labels
project/OGC Related to OGC testbeds or relavant projects. triage/conformance Issue related to fixing/ensuring compliance to specifications. triage/feature New requested feature.

Comments

@fmigneault
Copy link
Collaborator

fmigneault commented Apr 28, 2021

PR opengeospatial/ogcapi-processes#172 introduces the requirements for schema provided in every input and output definition to represent the expected format of value when submitting inputs and retrieving output results.

This field can be easily added for basic types that are defined by Literal I/O and Complex I/O since the type of value is always known. The multiplicity via minOccurs and maxOccurs can also be used to formulate the corresponding JSON schema fields and whether the expected schema of value is a direct value or an array of them. The AllowedValues and SupportedValues definitions can be used to define the enum values of a string, if needed, similarly to how it is already resolved to form the CWL payload. Ranges, min/max int/float values require slightly more logic, but should also be solvable with corresponding WPS/CWL parameters.

When supporting this feature, the corresponding "Requirements Class" with "JSON Schema Level" should be added to the conformance list accordingly to how much we support (currently only Level 0).
https://github.com/pvretano/ogcapi-processes/blob/issue-170/core/clause_7b_jsonschema.adoc

update: Levels were removed, feature superseded by PR opengeospatial/ogcapi-processes#181

todo

  • Update conformance list with JSON schema support
  • Update I/O JSON generation in process description outputs to provide the computed schema definition
  • For every Deploy I/O, the schema should be optional to remain backward compatible. If provided, it should be used as-is in the resulting process I/O (after validation that it is a proper OpenAPI schema definition).
  • For every *Described process I/O, schema should be required (as per OGC-API). Missing (omitted) explicit specification from deployment, for builtin processes, or already existing processes, schema should be generated transparently from other I/O metadata to fulfill the requirement.
  • Update FormatSchema to employ FileURL instead of ReferenceURL since other variants are not publicly accessible nor resolvable by schema validators ignored
    class FormatSchema(OneOfKeywordSchema):
    _one_of = [
    # pointer to a file or JSON schema relative item (as in OpenAPI definitions)
    ReferenceURL(description="Reference where the schema definition can be retrieved to describe referenced data."),
    # literal JSON schema, permissive since it can be anything
    PermissiveMappingSchema(description="Explicit schema definition of the formatted reference data.")
    ]
  • Remove schema = FormatSchema(missing=drop) definitions in all [Deploy]Format[MimeType|MediaType] definitions since the schema will be one level higher, in the I/O definition itself rather than under formats field.
    Left for backward compatibility if used by some input that provided more details about the expected schema for a given media-type input/output, but unused.
  • Tests (items defined in opengeospatial/ogcapi-processes/core/abstract_tests/ogc-process-description)
@fmigneault fmigneault added triage/feature New requested feature. triage/conformance Issue related to fixing/ensuring compliance to specifications. project/OGC Related to OGC testbeds or relavant projects. labels Apr 28, 2021
@fmigneault fmigneault self-assigned this Apr 28, 2021
@fmigneault fmigneault added this to the OGC-API Conformances milestone May 10, 2021
@fmigneault fmigneault changed the title [Feature] Support I/O schema definition [Feature] Support I/O schema field definition Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project/OGC Related to OGC testbeds or relavant projects. triage/conformance Issue related to fixing/ensuring compliance to specifications. triage/feature New requested feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant