From 64bfc62bdb0cf94a5fa1f63756ab50e242f5d136 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Jul 2019 17:52:36 +0200 Subject: [PATCH] nullable on the top-level element doesn't work well with anyOf/allOf/oneOf, therefore allow null as part of the other sub-schemas. See https://github.com/OAI/OpenAPI-Specification/issues/1368 and related issues. Added changelog, improved travis config. --- .travis.yml | 8 +++++--- CHANGELOG.md | 9 +++++++++ openapi.json | 43 ++++++++++++++++++++++++++----------------- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e5bb3ae..3e418b28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ language: python python: - "3.5" -node_js: 8 +node_js: +- "8" sudo: required @@ -12,6 +13,9 @@ before_install: - speccy lint openapi.json -r "speccy.yml" - pip install openapi-spec-validator - openapi-spec-validator openapi.json +# DIY example validation (PR#194) +- pip install -r tests/requirements.txt +- pytest tests install: - pip install mkdocs @@ -21,10 +25,8 @@ install: - pip install pygments - npm install -g asyncapi-generator@0.6.7 # 0.7 only supports AsyncAPI 2.0 - npm install -g concat-json-files -- pip install -r tests/requirements.txt # DIY example validation (PR#194) script: -- pytest tests # DIY example validation (PR#194) - concat-json-files "processes/*.json" -t "processes.json" - mv CHANGELOG.md docs/changelog.md - ag subscriptions.json markdown diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a18080b..22676fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed +- Improved documentation with clarifications and more. +- Fixed invalid examples +- SAR Bands had a required but undefined property. [#187](https://github.com/Open-EO/openeo-api/issues/187) +- [Removed `null` from SAR Bands enum, is handled by `nullable`](https://github.com/OAI/OpenAPI-Specification/issues/1900). +- [`nullable` doesn't combine well with `anyOf`, `allOf` and `oneOf`, therefore placed `nullable` in the sub-schemas](https://github.com/OAI/OpenAPI-Specification/issues/1368). + ## [0.4.1] - 2019-05-29 ### Changed diff --git a/openapi.json b/openapi.json index eecf7baf..029f548a 100644 --- a/openapi.json +++ b/openapi.json @@ -821,16 +821,17 @@ "minItems": 2, "maxItems": 2, "items": { + "nullable": true, "anyOf": [ { - "type": "number" + "type": "number", + "nullable": true }, { "type": "string", "format": "date-time" } - ], - "nullable": true + ] } }, "values": { @@ -838,9 +839,11 @@ "description": "If the property consists of [nominal](https://en.wikipedia.org/wiki/Level_of_measurement#Nominal_level), a set of all potential values can be specified. Only primitive data types allowed.", "type": "array", "items": { + "nullable": true, "anyOf": [ { - "type": "number" + "type": "number", + "nullable": true }, { "type": "string" @@ -852,8 +855,7 @@ { "type": "boolean" } - ], - "nullable": true + ] } } } @@ -4113,6 +4115,10 @@ "description": "Whenever no value for the variable is defined, the default value is used.", "nullable": true, "anyOf": [ + { + "type": "object", + "nullable": true + }, { "type": "string" }, @@ -4126,9 +4132,6 @@ { "type": "boolean" }, - { - "type": "object" - }, { "$ref": "#/components/schemas/process_graph" } @@ -4172,6 +4175,11 @@ "description": "Arguments for a process. See the API documentation for more information.", "nullable": true, "anyOf": [ + { + "type": "object", + "nullable": true, + "title": "Object" + }, { "type": "string", "title": "String" @@ -4184,10 +4192,6 @@ "type": "boolean", "title": "Boolean" }, - { - "type": "object", - "title": "Object" - }, { "type": "array", "title": "Array", @@ -4210,7 +4214,8 @@ "description": "The ID of the node that data is expected to come from.", "type": "string" } - } + }, + "additionalProperties": false }, { "type": "object", @@ -4224,7 +4229,8 @@ "description": "The name of the parameter that is made available to a callback by a calling process.", "type": "string" } - } + }, + "additionalProperties": false }, { "type": "object", @@ -4237,7 +4243,8 @@ "callback": { "$ref": "#/components/schemas/process_graph" } - } + }, + "additionalProperties": false } ] }, @@ -4593,7 +4600,9 @@ "arguments": { "$ref": "#/components/schemas/process_arguments" }, - "returns": {} + "returns": { + "nullable": true + } } } },