Skip to content

JSON-schema fixes to allow more flexible OAS3.0/3.1 integration#306

Merged
mr-c merged 4 commits intocommon-workflow-language:mainfrom
fmigneault:fix-json-schema
Mar 21, 2026
Merged

JSON-schema fixes to allow more flexible OAS3.0/3.1 integration#306
mr-c merged 4 commits intocommon-workflow-language:mainfrom
fmigneault:fix-json-schema

Conversation

@fmigneault
Copy link
Contributor

@fmigneault fmigneault commented Mar 20, 2026

Fixes highlighted in opengeospatial/ogcapi-processes#561

Avoids some OAS 3.0/3.1 vs JSON-schema subtleties, notably:

  • type arrays (OAS3.0 doesn't like them)
    ➡️ oneOf of these type one by one
  • exclusiveMinimum as bool (OAS3.0) vs numeric (all others)
    ➡️ just remove it, use minimum: 0 as "close enough"
  • missing type: 'null' support (OAS3.0 using nullable: true)
    ➡️ "hack" enum: [null], nullable: true (OAS3.1 and pure JSON-schema should ignore nullable)
  • remove InlineJavascriptLibraries.expressionLib marked as required
    ➡️ it is not required (https://www.commonwl.org/v1.2/CommandLineTool.html#InlineJavascriptRequirement)
    it was not raising before because the indent of required was wrong and ignored
  • remove additional properties (copy-paste error?) from ScatterMethod string
    (properties that were listed are relevant for ToolTimeLimit requirement/hint, and are defined)

Sample integration with Swagger in the context of OGC API processes that needs OAS 3.0.

{A330F013-675E-417C-9653-B6607A80304E}
openapi: 3.0.0
info:
   version: '2.0'
   title: "OGC API - Processes"
paths:
  "/processes":
    post:
      requestBody:
        description: |-
          An OGC Application Package used to deploy a new process.
        required: true
        content:
          #application/ogcapppkg+json:
          #  schema:
          #    $ref: "https://raw.githubusercontent.com/opengeospatial/ogcapi-processes/refs/heads/master/openapi/schemas/processes-dru/ogcapppkg.yaml"
          application/cwl:
            schema:
              $ref: "https://raw.githubusercontent.com/fmigneault/cwl-v1.2/refs/heads/fix-json-schema/json-schema/cwl.yaml"
          application/cwl+json:
            schema:
              $ref: "https://raw.githubusercontent.com/fmigneault/cwl-v1.2/refs/heads/fix-json-schema/json-schema/cwl.yaml"
          application/cwl+yaml:
            schema:
              $ref: "https://raw.githubusercontent.com/fmigneault/cwl-v1.2/refs/heads/fix-json-schema/json-schema/cwl.yaml"
      responses:
        "204":
          description: "no body"

@fmigneault
Copy link
Contributor Author

@mr-c FYI
Corresponding definitions seems to be functional on OGC side.

@mr-c
Copy link
Member

mr-c commented Mar 21, 2026

Thank you @fmigneault !

@mr-c mr-c merged commit 551d58d into common-workflow-language:main Mar 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants