opengeospatial / ogcapi-processes

Home Page:https://ogcapi.ogc.org/processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Explicit schema references for listing of qualified value or links as inputs/outputs items

fmigneault opened this issue · comments

Using this definition:

oneOf:
- $ref: "inputValueNoObject.yaml"
- $ref: "qualifiedInputValue.yaml"
- $ref: "../common-core/link.yaml"

It is possible to define the following:

outputs:
  inline_value_output: "abc"
  inline_array_output: [1, 2, 3]
  qualified_json_output:
    mediaType: application/json
    value: {"xyz": 123}
  link_output:
    type: application/json
    href: "https://host.com/some.json"

But there is no explicit reference for this kind of structure:

outputs:
  qualified_array_output:
    - mediaType: text/plain
      value: xyz
    - mediaType: application/json
      value: {"abc": 123}
    - type: application/json
      href: "https://host.com/some.json"

Because inputValueNoObject explicitly omits the object type to ensure it is instead embedded within a (qualified) value, that more context (i.e.: with mediaType, schema, etc.) can be provided, and to avoid ambiguous nested-objects schemas, there seems to be an implicit hint that an array of objects/links could also be defined.

While the above qualified value/link array will "work" because of the following schema, the intention is not as clear as for the case of non-array value outputs.

The lack of something more concrete than the "anything" (i.e.: {}) does not help implementers know whether an array of qualified inputs/outputs is a valid construct or not, or rather, whether clients should be able to handle these cases.

Should the schemas be more explicit about his use case?