From 7ed871441f9e81b81348ac6ee2da47bb04c98d3f Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 9 Apr 2020 17:52:54 +0200 Subject: [PATCH 1/2] Attempt to fix #268: User-defined process parameters are recursively defined --- openapi.yaml | 81 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 22 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index c947dbf8..2d0d9cf0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2587,7 +2587,7 @@ paths: description: List of parameters made available to process graphs. type: array items: - $ref: '#/components/schemas/process_parameter' + $ref: '#/components/schemas/parameter' links: description: |- Links related to this service type, e.g. more @@ -4695,7 +4695,7 @@ components: description: $ref: '#/components/schemas/process_description' schema: - $ref: '#/components/schemas/process_schema' + $ref: '#/components/schemas/data_type_schema' process_experimental: type: boolean description: >- @@ -4787,13 +4787,11 @@ components: process graph, if one is specified. items: $ref: '#/components/schemas/process_parameter' - process_parameter: - title: Process Parameter + base_parameter: type: object required: - name - description - - schema properties: name: type: string @@ -4817,8 +4815,26 @@ components: The default value for this parameter. Required parameters SHOULD NOT specify a default value. Optional parameters SHOULD always specify a default value. nullable: true - schema: - $ref: '#/components/schemas/process_schema' + parameter: + title: Parameter + allOf: + - $ref: '#/components/schemas/base_parameter' + - type: object + required: + - schema + properties: + schema: + $ref: '#/components/schemas/data_type_schema' + process_parameter: + title: Process Parameter + allOf: + - $ref: '#/components/schemas/base_parameter' + - type: object + required: + - schema + properties: + schema: + $ref: '#/components/schemas/parameter_schema' job_id: type: string description: >- @@ -5070,23 +5086,46 @@ components: example: - href: 'http://www.openeo.org/docs/errors/SampleError' rel: about - process_schema: - title: Supported Data Type(s) - description: >- - Either a single data type or a list of data types. + data_type_schema: + title: Data Types + description: Either a single data type or a list of data types. oneOf: - - $ref: '#/components/schemas/process_json_schema' + - $ref: '#/components/schemas/json_schema' - title: Multiple data types - description: |- - A list of data types this parameter or return value supports, specified as JSON Schemas. - - Note: To validate the list of JSON Schemas using a JSON Schema validator, wrap the list of schemas in an object with a property `anyOf`: `{"anyOf": ...}` + description: A list of data types this parameter supports, specified as JSON Schemas. + type: array + minItems: 1 + uniqueItems: true + items: + $ref: '#/components/schemas/json_schema' + parameter_schema: + title: Parameter Data Types + description: Either a single data type or a list of data types. + oneOf: + - $ref: '#/components/schemas/parameter_json_schema' + - title: Multiple data types + description: A list of data types supported, specified as JSON Schemas. type: array minItems: 1 uniqueItems: true items: - $ref: '#/components/schemas/process_json_schema' - process_json_schema: + $ref: '#/components/schemas/parameter_json_schema' + parameter_json_schema: + title: Single Data Type + allOf: + - $ref: '#/components/schemas/json_schema' + - type: object + properties: + parameters: + type: array + description: |- + A list of parameters passed to the child process graph. + + The order in the array corresponds to the parameter order to + be used in clients that don't support named parameters. + items: + $ref: '#/components/schemas/parameter' + json_schema: type: object title: Single data type description: |- @@ -5116,8 +5155,6 @@ components: $ref: '#/components/schemas/json_schema_type' subtype: type: string - parameters: - $ref: '#/components/schemas/process_parameters' pattern: type: "string" format: "regex" @@ -5140,8 +5177,8 @@ components: - type: array minItems: 1 items: - $ref: '#/components/schemas/process_json_schema' - - $ref: '#/components/schemas/process_json_schema' + $ref: '#/components/schemas/json_schema' + - $ref: '#/components/schemas/json_schema' additionalProperties: true json_schema_type: type: string From b397029d73d0b126553158692c8b1e7f748ae16f Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 9 Apr 2020 17:57:48 +0200 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 174cae9a..330d0092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `GET /service_types`: Added optional `title` and `description` properties for service types. [#266](https://github.com/Open-EO/openeo-api/issues/266) - `GET /file_formats`: Added optional `description` property for file formats. [#266](https://github.com/Open-EO/openeo-api/issues/266) +### Fixed +- Parameters passed to child process graphs are not defined recursively any longer. [#268](https://github.com/Open-EO/openeo-api/issues/268) +- Parameters for child process graphs are not specified for return values and service type parameters any longer. [#268](https://github.com/Open-EO/openeo-api/issues/268) + ## 1.0.0-rc.2 - 2020-02-20 ### Added