Skip to content

Commit

Permalink
Add required yaml files composed of various existing schemas
Browse files Browse the repository at this point in the history
Add short documentation on how to generate the desired files.

Small fix to make operationId unique
  • Loading branch information
gfenoy committed May 30, 2023
1 parent e98f6f7 commit 26e325b
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 22 deletions.
35 changes: 28 additions & 7 deletions openapi/ogcapi-processes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,36 @@ paths:

# OGC API - Processes - Part 1: Core
/processes:
oneOf:
- $ref: 'paths/processes-core/pProcessList.yaml'
- $ref: 'paths/processes-dru/pDeploy.yaml'
# If OGC API - Part 1 only uncomment the line below
#$ref: 'paths/processes-core/pProcessList.yaml'

# OGC API - Processes Part 2: Deploy, Replace, Undeploy
# The file below is produced with the following command:
#
# rm paths/processes-dru/pProcessListDeploy.yaml ; \
# for i in processes-core/pProcessList.yaml \
# processes-dru/pDeploy.yaml ; \
# do \
# cat paths/$i >> paths/processes-dru/pProcessListDeploy.yaml;
# done
#
$ref: 'paths/processes-dru/pProcessListDeploy.yaml'

This comment has been minimized.

Copy link
@jerstlouis

jerstlouis May 31, 2023

Member

@gfenoy Is this because of the difficulty to support multiple operations methods e.g., GET, POST) at the same path (as per OAI/OpenAPI-Specification#417 and OAI/OpenAPI-Specification#2922)?

The goal of this main yaml file is to keep that main file short so as to make it easy to combine multiple OGC APIs in one top-level document, and the lengthy explanations and the script to generate combined paths kind of get in the way here. Very unfortunate that it is not supported yet by OpenAPI.

Perhaps moving the instructions to the pProcessListDeploy.yaml would address my biggest concern of keeping ogcapi-process.yaml short & sweet. This would also make it obvious when looking at that file by having the comment at the top that this file is auto-generated and should not be manually modified. We could also potentially set up the GitHub actions to auto-generate it. In some repos (e.g., Coverages) the bundled JSON is already auto-generated by a GitHub action.

This comment has been minimized.

Copy link
@gfenoy

gfenoy May 31, 2023

Author Contributor

Thanks @jerstlouis for you your comment. Solved in 1cfc632


/processes/{processId}:
oneOf:
- $ref: 'paths/processes-core/pProcessDescription.yaml'
- $ref: 'paths/processes-dru/pReplace.yaml'
- $ref: 'paths/processes-dru/pUndeploy.yaml'
# OGC API - Processes Part 1: Core
#$ref: 'paths/processes-core/pProcessDescription.yaml'

# OGC API - Processes Part 2: Deploy, Replace, Undeploy
# Use the following command to generate the file :
#
# rm paths/processes-dru/pProcessDescriptionReplaceUndeploy.yaml; \
# for i in processes-core/pProcessDescription.yaml \
# processes-dru/pReplace.yaml \
# processes-dru/pUndeploy.yaml ; \
# do \
# cat paths/$i >> paths/processes-dru/pProcessDescriptionReplaceUndeploy.yaml ;\
# done
$ref: 'paths/processes-dru/pProcessDescriptionReplaceUndeploy.yaml'

/processes/{processId}/execution:
$ref: 'paths/processes-workflows/pExecution-workflows.yaml'
Expand Down
15 changes: 8 additions & 7 deletions openapi/paths/processes-dru/pDeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ post:
Deploys a process.
For more information, see [Section 6.3](http://docs.ogc.org/DRAFTS/20-044.html#_87a6983e-d060-458c-95ab-27e232e64822).
operationId: execute
operationId: deploy
tags:
- DRU
parameters:
Expand All @@ -14,12 +14,13 @@ post:
An OGC Application Package used to deploy a new process.
required: true
content:
oneOf:
- application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
- application/cwl
- application/cwl+json
application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
application/cwl:
example: "empty"
application/cwl+json:
example: "{empty}"
responses:
201:
$ref: "../../schemas/processes-core/processSummary.yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Process Description
get:
summary: retrieve a process description
description: |
The process description contains information about inputs and outputs and a link to the execution-endpoint for the process. The Core does not mandate the use of a specific process description to specify the interface of a process. That said, the Core requirements class makes the following recommendation:
Implementations SHOULD consider supporting the OGC process description.
For more information, see [Section 7.8](https://docs.ogc.org/is/18-062r2/18-062r2.html#sc_process_description).
operationId: getProcessDescription
tags:
- Processes
parameters:
- $ref: "../../parameters/processes-core/processId-path.yaml"
responses:
200:
$ref: "../../responses/processes-core/rProcessDescription.yaml"
404:
$ref: "../../responses/common-core/rNotFound.yaml"
put:
summary: replace a process.
description: |
Replaces a process.
For more information, see [Section 6.4](http://docs.ogc.org/DRAFTS/20-044.html#_18582f42-ebc6-4284-9333-c089068f62b6).
operationId: replace
tags:
- DRU
parameters:
- $ref: "../../parameters/processes-core/processId-path.yaml"
requestBody:
description: |-
An OGC Application Package used to deploy a new process.
required: true
content:
application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
application/cwl:
example: "empty"
application/cwl+json:
example: "{empty}"
responses:
204:
$ref: "../../responses/processes-dru/rEmpty.yaml"
403:
$ref: "../../responses/processes-dru/rImmutableProcess.yaml"
404:
$ref: "../../responses/common-core/rNotFound.yaml"
409:
$ref: "../../responses/processes-dru/rDuplicateProcess.yaml"
500:
$ref: "../../responses/common-core/rServerError.yaml"
delete:
summary: undeploy a process.
description: |
Undeploys a process.
For more information, see [Section 6.5](http://docs.ogc.org/DRAFTS/20-044.html#_16391f9e-538f-4a84-9710-72a6bab82842).
operationId: undeploy
tags:
- DRU
parameters:
- $ref: "../../parameters/processes-core/processId-path.yaml"
responses:
204:
$ref: "../../responses/processes-dru/rEmpty.yaml"
403:
$ref: "../../responses/processes-dru/rImmutableProcess.yaml"
404:
$ref: "../../responses/common-core/rNotFound.yaml"
500:
$ref: "../../responses/common-core/rServerError.yaml"
44 changes: 44 additions & 0 deletions openapi/paths/processes-dru/pProcessListDeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
get:
summary: retrieve the list of available processes
description: |
The list of processes contains a summary of each process the OGC API - Processes offers, including the link to a more detailed description of the process.
For more information, see [Section 7.7]https://docs.ogc.org/is/18-062r2/18-062r2.html#sc_process_list).
operationId: getProcesses
tags:
- Processes
responses:
200:
$ref: "../../responses/processes-core/rProcessList.yaml"
post:
summary: deploy a process.
description: |
Deploys a process.
For more information, see [Section 6.3](http://docs.ogc.org/DRAFTS/20-044.html#_87a6983e-d060-458c-95ab-27e232e64822).
operationId: deploy
tags:
- DRU
parameters:
- $ref: "../../parameters/processes-dru/w-param.yaml"
requestBody:
description: |-
An OGC Application Package used to deploy a new process.
required: true
content:
application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
application/cwl:
example: "empty"
application/cwl+json:
example: "{empty}"
responses:
201:
$ref: "../../schemas/processes-core/processSummary.yaml"
403:
$ref: "../../responses/processes-dru/rImmutableProcess.yaml"
409:
$ref: "../../responses/processes-dru/rDuplicateProcess.yaml"
500:
$ref: "../../responses/common-core/rServerError.yaml"
15 changes: 8 additions & 7 deletions openapi/paths/processes-dru/pReplace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ put:
Replaces a process.
For more information, see [Section 6.4](http://docs.ogc.org/DRAFTS/20-044.html#_18582f42-ebc6-4284-9333-c089068f62b6).
operationId: execute
operationId: replace
tags:
- DRU
parameters:
Expand All @@ -14,12 +14,13 @@ put:
An OGC Application Package used to deploy a new process.
required: true
content:
oneOf:
- application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
- application/cwl
- application/cwl+json
application/ogcapppkg+json:
schema:
$ref: "../../schemas/processes-dru/ogcapppkg.yaml"
application/cwl:
example: "empty"
application/cwl+json:
example: "{empty}"
responses:
204:
$ref: "../../responses/processes-dru/rEmpty.yaml"
Expand Down
2 changes: 1 addition & 1 deletion openapi/paths/processes-dru/pUndeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ delete:
Undeploys a process.
For more information, see [Section 6.5](http://docs.ogc.org/DRAFTS/20-044.html#_16391f9e-538f-4a84-9710-72a6bab82842).
operationId: execute
operationId: undeploy
tags:
- DRU
parameters:
Expand Down

0 comments on commit 26e325b

Please sign in to comment.