From 5d7de721e767b8340cac2ac7045faa021da439b8 Mon Sep 17 00:00:00 2001 From: Panagiotis Vretanos Date: Sun, 2 Feb 2025 23:59:34 -0500 Subject: [PATCH 1/5] Clarify 200 responses for JSON and HTML content. --- core/recommendations/html/PER_media-types.adoc | 9 +++++++++ core/recommendations/json/PER_media-types.adoc | 9 +++++++++ core/requirements/html/REQ_definition.adoc | 18 ++++++++++++++++-- core/requirements/json/REQ_definition.adoc | 9 ++++----- core/sections/clause_10_encodings.adoc | 3 +++ 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 core/recommendations/html/PER_media-types.adoc create mode 100644 core/recommendations/json/PER_media-types.adoc diff --git a/core/recommendations/html/PER_media-types.adoc b/core/recommendations/html/PER_media-types.adoc new file mode 100644 index 00000000..e773d74a --- /dev/null +++ b/core/recommendations/html/PER_media-types.adoc @@ -0,0 +1,9 @@ +[[per_html_media-types]] +[permission] +==== +[%metadata] +identifier:: /per/html/media-types +label:: /per/html/media-types + +A HTML media type may be further qualified with additional subtype, suffix and parameter components. For example, `test/html; charset=UTF-8`. +==== diff --git a/core/recommendations/json/PER_media-types.adoc b/core/recommendations/json/PER_media-types.adoc new file mode 100644 index 00000000..c47ef4b2 --- /dev/null +++ b/core/recommendations/json/PER_media-types.adoc @@ -0,0 +1,9 @@ +[[per_json_media-types]] +[permission] +==== +[%metadata] +identifier:: /per/json/media-types +label:: /per/json/media-types + +A JSON media type may be further qualified with additional subtype, suffix and parameter components. For example, `application/ld+json; charset=UTF-8`. +==== diff --git a/core/requirements/html/REQ_definition.adoc b/core/requirements/html/REQ_definition.adoc index 0f495df0..189de7fd 100644 --- a/core/requirements/html/REQ_definition.adoc +++ b/core/requirements/html/REQ_definition.adoc @@ -5,6 +5,20 @@ identifier:: /req/html/definition label:: /req/html/definition -Every `200`-response of an operation of the server -SHALL support the media type `text/html`. +`200`-responses of the server SHALL support the following media type: + +* `text/html` + +for the following API endpoints: + +* <>, +* <>, +* <>, +* <>, +* <> +==== + +[NOTE] +==== +Responses from the execution endpoint <> may or may not generate HTML depending on the process being executed, the <>, the negotiated response format (specified using the https://www.rfc-editor.org/rfc/rfc2616#section-14.1[HTTP Accept] header or the <> query parameter) and the <>. ==== diff --git a/core/requirements/json/REQ_definition.adoc b/core/requirements/json/REQ_definition.adoc index e097bfa1..6e502170 100644 --- a/core/requirements/json/REQ_definition.adoc +++ b/core/requirements/json/REQ_definition.adoc @@ -16,10 +16,9 @@ for the following API endpoints: * <>, * <>, * <> +==== -and for the following API endpoint: - -* <> - -when the negotiated response format using the https://www.rfc-editor.org/rfc/rfc2616#section-14.1[HTTP Accept] header or the <> parameter is JSON, or the <> or the <> is asynchronous. +[NOTE] +==== +Responses from the execution endpoint <> may or may not generate JSON depending on the process being executed, the <>, the negotiated response format (specified using the https://www.rfc-editor.org/rfc/rfc2616#section-14.1[HTTP Accept] header or the <> query parameter) and the <>. ==== diff --git a/core/sections/clause_10_encodings.adoc b/core/sections/clause_10_encodings.adoc index e3d8b045..8e95b02e 100644 --- a/core/sections/clause_10_encodings.adoc +++ b/core/sections/clause_10_encodings.adoc @@ -42,6 +42,7 @@ include::../requirements/requirements_class_json.adoc[] include::../requirements/json/REQ_definition.adoc[] +include::../recommendations/json/PER_media-types.adoc[] [[sc_requirements_class_html]] === Requirement Class "HTML" @@ -52,4 +53,6 @@ include::../requirements/requirements_class_html.adoc[] include::../requirements/html/REQ_definition.adoc[] +include::../recommendations/html/PER_media-types.adoc[] + include::../requirements/html/REQ_content.adoc[] From abb0db95516b840e52f4d5aaed264c08e12af6ff Mon Sep 17 00:00:00 2001 From: Panagiotis Vretanos Date: Mon, 3 Feb 2025 00:41:31 -0500 Subject: [PATCH 2/5] Do not reference YAML schemas from JSON examples. --- core/examples/json/ProcessDescription.json | 6 +-- core/examples/json/bbox.json | 44 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 core/examples/json/bbox.json diff --git a/core/examples/json/ProcessDescription.json b/core/examples/json/ProcessDescription.json index e33c03a3..eb2969a4 100644 --- a/core/examples/json/ProcessDescription.json +++ b/core/examples/json/ProcessDescription.json @@ -132,7 +132,7 @@ "format": "ogc-bbox" }, { - "$ref": "../../openapi/schemas/bbox.yaml" + "$ref": "bbox.json" } ] } @@ -285,7 +285,7 @@ "format": "geojson-geometry" }, { - "$ref": "http://schemas.opengis.net/ogcapi/features/part1/1.0/openapi/schemas/geometryGeoJSON.yaml" + "$ref": "https://geojson.org/schema/Geometry.json" } ] } @@ -299,7 +299,7 @@ "format": "ogc-bbox" }, { - "$ref": "../../openapi/schemas/bbox.yaml" + "$ref": "bbox.json" } ] } diff --git a/core/examples/json/bbox.json b/core/examples/json/bbox.json new file mode 100644 index 00000000..fcb81b00 --- /dev/null +++ b/core/examples/json/bbox.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Bounding Box", + "type": "object", + "required": [ + "bbox" + ], + "properties": { + "bbox": { + "type": "array", + "oneOf": [ + { + "minItems": 4, + "maxItems": 4 + }, + { + "minItems": 6, + "maxItems": 6 + } + ], + "items": { + "type": "number" + } + }, + "crs": { + "anyOf": [ + { + "type": "string", + "format": "uri", + "enum": [ + "http://www.opengis.net/def/crs/OGC/1.3/CRS84", + "http://www.opengis.net/def/crs/OGC/0/CRS84h" + ], + "default": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + }, + { + "type": "string", + "format": "uri", + "default": "http://www.opengis.net/def/crs/OGC/1.3/CRS84" + } + ] + } + } +} From 105a1934b47bb5e6026440da7427a77ab8caf55e Mon Sep 17 00:00:00 2001 From: Panagiotis Vretanos Date: Mon, 3 Feb 2025 00:51:48 -0500 Subject: [PATCH 3/5] Change oneOf to anyOf to fix validation issue. --- openapi/schemas/processes-core/inputValueNoObject.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/schemas/processes-core/inputValueNoObject.yaml b/openapi/schemas/processes-core/inputValueNoObject.yaml index b520afd7..a5ab02e0 100644 --- a/openapi/schemas/processes-core/inputValueNoObject.yaml +++ b/openapi/schemas/processes-core/inputValueNoObject.yaml @@ -1,4 +1,4 @@ -oneOf: +anyOf: - type: string - type: number - type: integer From 1c6cc4b86b56d4cfa897c3f922d21b736f93c70f Mon Sep 17 00:00:00 2001 From: Panagiotis Vretanos Date: Mon, 3 Feb 2025 00:57:25 -0500 Subject: [PATCH 4/5] Add recursive reference to inputValue.yaml. --- openapi/schemas/processes-core/inputValueNoObject.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi/schemas/processes-core/inputValueNoObject.yaml b/openapi/schemas/processes-core/inputValueNoObject.yaml index a5ab02e0..b3d467fb 100644 --- a/openapi/schemas/processes-core/inputValueNoObject.yaml +++ b/openapi/schemas/processes-core/inputValueNoObject.yaml @@ -4,6 +4,7 @@ anyOf: - type: integer - type: boolean - type: array - items: {} + items: + $ref: "inputValue.yaml" - $ref: "binaryInputValue.yaml" - $ref: "bbox.yaml" From c2446de1c00044a725f176b90c0736482d7d4d72 Mon Sep 17 00:00:00 2001 From: Panagiotis Vretanos Date: Mon, 3 Feb 2025 01:12:45 -0500 Subject: [PATCH 5/5] Consistently use "successful" status code. --- core/sections/clause_7_core.adoc | 2 +- openapi/responses/processes-job-management/rLocked.yaml | 2 +- openapi/schemas/processes-core/statusCode.yaml | 2 +- openapi/schemas/processes-job-management/statusCode.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/sections/clause_7_core.adoc b/core/sections/clause_7_core.adoc index 44184ce7..369dc031 100644 --- a/core/sections/clause_7_core.adoc +++ b/core/sections/clause_7_core.adoc @@ -30,7 +30,7 @@ A HTTP POST request to the execution-endpoint creates a new job. The inputs and The URL for accessing status information is delivered in the HTTP header `location`. -After a process is finished (status = success/failed), the results/exceptions can be retrieved. +After a process is finished (status = successful/failed), the results/exceptions can be retrieved. [[img_core]] .Resources in the Core requirements class diff --git a/openapi/responses/processes-job-management/rLocked.yaml b/openapi/responses/processes-job-management/rLocked.yaml index c015d651..154b5e01 100644 --- a/openapi/responses/processes-job-management/rLocked.yaml +++ b/openapi/responses/processes-job-management/rLocked.yaml @@ -1,4 +1,4 @@ -description: Job is locked. For example, the `status` of the job is currently something else than `succeeded`, `failed` and `created`. +description: Job is locked. For example, the `status` of the job is currently something else than `successful`, `failed` and `created`. content: application/json: schema: diff --git a/openapi/schemas/processes-core/statusCode.yaml b/openapi/schemas/processes-core/statusCode.yaml index 8c6a6850..f30262c9 100644 --- a/openapi/schemas/processes-core/statusCode.yaml +++ b/openapi/schemas/processes-core/statusCode.yaml @@ -3,6 +3,6 @@ nullable: false enum: - accepted - running - - succeeded + - successful - failed - dismissed diff --git a/openapi/schemas/processes-job-management/statusCode.yaml b/openapi/schemas/processes-job-management/statusCode.yaml index e5c61562..b4bf1e6e 100644 --- a/openapi/schemas/processes-job-management/statusCode.yaml +++ b/openapi/schemas/processes-job-management/statusCode.yaml @@ -4,6 +4,6 @@ enum: - created - accepted - running - - succeeded + - successful - failed - dismissed