Skip to content

Fixes for #564 (full alignment of outputs / inputs schemas with maxOccurs)#566

Merged
jerstlouis merged 17 commits into
masterfrom
fix564
Mar 31, 2026
Merged

Fixes for #564 (full alignment of outputs / inputs schemas with maxOccurs)#566
jerstlouis merged 17 commits into
masterfrom
fix564

Conversation

@jerstlouis
Copy link
Copy Markdown
Member

@jerstlouis jerstlouis commented Mar 27, 2026

This implements the proposed fixes for #564

(please focus on the last commit c426de7 , as this PR is otherwise based on #561 which fixes the validation of the OpenAPI definition)

- Fixed references to non-existing files (e.g., files were renamed to remove "input", rWorkflowNotFound.yaml was never added)
- Updated processes-workflows to reflect capabilities now included in Part 1 - Core (Version 2)
- pExecution: Part 1 now supports collection output
- Adding workflow definitions in schemas
- The default example has workflows enabled, and this fixes Swagger Editor errors
- NOTE: Additional fixes are needed for `swagger-cli validate` and SwaggerUI to work properly
- This fixes "properties members must be schemas" errors in Swagger Editor
- Including CWL definition in schemas (fixes swagger-cli bundle issues in Swagger Editor)
- Referencing online JSON Schema is likely not compatible with OpenAPI 3.0 and causing 'swagger-cli validate' to fail.
- Including schema.yaml from https://schemas.opengis.net/ogcapi/dggs/1.0/core/schemas/dggs-json/schema.yaml although we could also
  go back to the version that was removed in aa202c0
- The $comment is causing Swagger validation to fail
- Changing top-level CQL2-JSON to be an arbitrary object (couldn't a CQL2 expression be a function returning bool?) -- also args should have been an array
- The examples was causing validation to fail
- contentEncoding was causing validation to fail
- Additional fixes are needed to avoid errors in Swagger Editor / UI
- The use of $defs in CQL2 schema was causing these Swagger Editor errors:
    '$ref' value must be an RFC3986-compliant URI reference
 (now using cql2defs instead of $defs)
- With this, Swagger Editor now only reports warnings, but Swagger UI still shows 'invalid' with these errors, related to:
  - CWL and CQL2 using $schema, $author, $id, $defs, $dynamicAnchors and cql2defs
  - DRU pDeploy.yaml and pProcessListDeploy.yaml wrongly directly including the processSummary.yaml schema where a response is expected
   (I'll file a separate issue about this -- it should use an response to be added to responses/processes-dru/ if one does not already exist)
{
  "messages": [
    "attribute components.schemas.CWL.$schema is unexpected",
    "attribute components.schemas.CWL.$author is unexpected",
    "attribute components.schemas.CWL.$id is unexpected",
    "attribute components.schemas.CWL.$defs is unexpected",
    "attribute components.schemas.CQL2.$schema is unexpected",
    "attribute components.schemas.CQL2.$dynamicAnchor is unexpected",
    "attribute components.schemas.CQL2.cql2Defs is unexpected",
    "paths.'/processes'(post).responses.201.$ref target #/components/schemas/processSummary is not of expected type Response"
  ],
  "schemaValidationMessages": [
    {
      "level": "error",
      "domain": "validation",
      "keyword": "oneOf",
      "message": "instance failed to match exactly one schema (matched 0 out of 2)",
      "schema": {
        "loadingURI": "#",
        "pointer": "/definitions/Components/properties/schemas/patternProperties/^[a-zA-Z0-9\\.\\-_]+$"
      },
      "instance": {
        "pointer": "/components/schemas/CQL2"
      }
    },
    {
      "level": "error",
      "domain": "validation",
      "keyword": "oneOf",
      "message": "instance failed to match exactly one schema (matched 0 out of 2)",
      "schema": {
        "loadingURI": "#",
        "pointer": "/definitions/Components/properties/schemas/patternProperties/^[a-zA-Z0-9\\.\\-_]+$"
      },
      "instance": {
        "pointer": "/components/schemas/CWL"
      }
    }
  ]
}
@jerstlouis jerstlouis requested review from gfenoy and pvretano March 27, 2026 06:54
@jerstlouis jerstlouis added 2.0 Next development iteration Part 1 (Core) OGC API - Processes - Part 1: Core labels Mar 27, 2026
@pvretano
Copy link
Copy Markdown
Contributor

As a native speaker of English I can tell you that the name "occurrencesHolder.yaml" is a meaningless name. Please rename the file to "inputOrResultValue.yaml".

@jerstlouis
Copy link
Copy Markdown
Member Author

jerstlouis commented Mar 27, 2026

@pvretano We can discuss what the proper name is, but this name was intended to carry the meaning of "something that holds occurrences" (of an input or result output value) :) Just like a cup holder holds a cup ;)

@fmigneault was strongly objecting to the use of input in the name...

I still think using value in the name is confusing because it might be multiple values (multiple occurrences), and all of the other YAML files with value in the filename are about individual value occurrences (not the holder / shell / input / output / result)

@pvretano
Copy link
Copy Markdown
Contributor

pvretano commented Mar 27, 2026

@jerstlouis change the name. It is meaningless and the term occurrence is not used once in the standard. If it can be one or more values then use the plural "values".

@jerstlouis
Copy link
Copy Markdown
Member Author

jerstlouis commented Mar 27, 2026

@pvretano

change the name.

What to? inputOrResultValues.yaml ?

the term occurrence is not used once in the standard.

Independently of what this file is called, in my opinion it would be very useful in the standard to talk about one or more occurences of values (as per minOccurs / maxOcccurs) in the context of the inputs and result outputs to clarify this lingering confusion between the two, explaining it a bit like I did in this comment (EDIT: Sorry I had linked to the wrong comment). This is certainly confusing readers/implementers, but also ourselves in the SWG (as per the JSON Schema clash issue identified by #564).

I suggest to use this as potential inspiration:

There is the input/output which is:

  • If maxOcccurs = 1: <occurrence>
  • If maxOccurs > 1: [ <occurrence>, ... ] (empty array allowed as well unless minOccurs > 0)

Where <occurrence> is one of:

  • { "value" : ... }
  • { "href" : ... }
  • { "bbox" : ... }
  • { "collection": ... }
  • a string
  • a number
  • true or false
  • an array
  • null

There is no confusion about an object defining a "value" property at the top level. That would always be encoded as:
{ "value" : {"value": 123 } }.

@pvretano
Copy link
Copy Markdown
Contributor

@jerstlouis inputOrResultsValues.yaml.

@jerstlouis
Copy link
Copy Markdown
Member Author

@pvretano Now there is an issue with results having an s and input not having one.

This file is about one or more (or 0) values for an individual input or result.

So I'll rename it to inputOrResultValues with no s at result.

@pvretano
Copy link
Copy Markdown
Contributor

@jerstlouis fine...

@jerstlouis
Copy link
Copy Markdown
Member Author

jerstlouis commented Mar 27, 2026

@pvretano Done. Thanks. See 5a666d0 .

- The draft only has `[ collection ]` in https://docs.ogc.org/DRAFTS/18-062r3.html#req_collection-output_response-definition[Requirement 62]
- If necessary, the results.yaml approach can return multiple output collections, or multiple collections per output
@fmigneault
Copy link
Copy Markdown
Member

So is it a good time to say that, including Part 3: Workflows, inputOrResultValues.yaml now is ambiguous, since it should be inputOrResultValues-OrProcess-OrParamerized.yaml because they can be nested?

inputOrResultValues-workflows.yaml is not that much more communicating the variants.

(my reasoning for making it abstract, but I didn't want to bring up too many extra concepts simultaneously until the first batch of renames were addressed)

@jerstlouis
Copy link
Copy Markdown
Member Author

jerstlouis commented Mar 28, 2026

@fmigneault

A nested process or a parameterized input ($input) would still be an input value to the process that receives it, so the name still fits.

The only thing is that inputParameterized and inputOrResultValues-workflows are only used for inputs, not for results, so we could potentially rename that one to simply inputValues-workflows.yaml, or keep like this to more easily see the relationship to the no-workflows version.

@fmigneault
Copy link
Copy Markdown
Member

fmigneault commented Mar 28, 2026

Good point. Fair enough. It highlights even more why they must be the same "value container" structure in this case!

@pvretano
Copy link
Copy Markdown
Contributor

Guys, are you serious now? We don't need long sentence like-file names! Even "inputOrResultValues.yaml" is too long but it is a sight better than "occuranceHolder.yaml" ... What is this? Dungeon & Dragons!?

Just call the file "values.yaml" and let the context dictate whether it is an input value, a result value, a nested value in a workflow or whatever. I want these PR's either merged or discarded on Monday so that I can complete my PRs so that we can get on with the RFC.

@fmigneault
Copy link
Copy Markdown
Member

Just call the file "values.yaml" and let the context dictate whether it is an input value, a result value, a nested value

I agree with this. A simple values.yaml is what I've proposed since the start.

@jerstlouis
Copy link
Copy Markdown
Member Author

@fmigneault @pvretano If you both want me to rename inputOrResultValues.yam to values.yaml in this PR and that will help agreeing to merge this PR tomorrow I'm happy to change it.

As long as we all remember (from this epic Dungeons & Dragons adventure ;)) that values.yaml is the shell / holder / container, while all the other files with value in them are for the individual values occurring zero, once, or multiple times inside that container.

@pvretano
Copy link
Copy Markdown
Contributor

@jerstlouis make the change.

@jerstlouis
Copy link
Copy Markdown
Member Author

@fmigneault @pvretano Done. Thanks!

…ecution request

- Fixes #564
- This avoids the need to use qualified array elements at a level which clashes with the process description schemas for individual input/output occurrences
- Output description can now specify minOccurs / maxOccurs
- For outputs where maxOccurs > 1, a single output still needs to be enclosed within [ ] (exactly like inputs)
- input.yaml is renamed to values.yaml and used directly by both execution requests input (execute.yaml), and results.yaml outputs
- output.yaml is renamed to outputSelection.yaml to clarify that the execution request selects outputs to return and their format and this schema does not define
  an actual output returned by a process
- inputValue.yaml is renamed to value.yaml because it's also for outputs
- valueNoObject.yaml is reverted to exactly what it was in 1.0, fixing the clash with the JSON Schema
- There are two versions of several of these files depending on whether Part 3: Workflows is used or not
  (Part 3 allows for additional "$input" placeholder (inputParameterized.yaml) for the purpose of defining a workflow)
- This is currently implemented on top of PR #561 fixing validation issues with the OpenAPI definition
Copy link
Copy Markdown
Contributor

@pvretano pvretano left a comment

Choose a reason for hiding this comment

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

As a native English speaker I can tell you that the name "occurencesHolder.yaml" is completely meaningless. The term "occurrence" is not used in the text of the standard. Please rename the file to "inputOrResultValue.yaml" (or Values if plural makes more sense).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0 Next development iteration Part 1 (Core) OGC API - Processes - Part 1: Core

Development

Successfully merging this pull request may close these issues.

3 participants