Skip to content

Commit

Permalink
nullable on the top-level element doesn't work well with anyOf/allOf/…
Browse files Browse the repository at this point in the history
…oneOf, therefore allow null as part of the other sub-schemas. See OAI/OpenAPI-Specification#1368 and related issues.

Added changelog, improved travis config.
  • Loading branch information
m-mohr committed Jul 3, 2019
1 parent 577fdf5 commit 64bfc62
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ language: python
python:
- "3.5"

node_js: 8
node_js:
- "8"

sudo: required

Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 26 additions & 17 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -821,26 +821,29 @@
"minItems": 2,
"maxItems": 2,
"items": {
"nullable": true,
"anyOf": [
{
"type": "number"
"type": "number",
"nullable": true
},
{
"type": "string",
"format": "date-time"
}
],
"nullable": true
]
}
},
"values": {
"title": "STAC Varying Collection Property Values",
"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"
Expand All @@ -852,8 +855,7 @@
{
"type": "boolean"
}
],
"nullable": true
]
}
}
}
Expand Down Expand Up @@ -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"
},
Expand All @@ -4126,9 +4132,6 @@
{
"type": "boolean"
},
{
"type": "object"
},
{
"$ref": "#/components/schemas/process_graph"
}
Expand Down Expand Up @@ -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"
Expand All @@ -4184,10 +4192,6 @@
"type": "boolean",
"title": "Boolean"
},
{
"type": "object",
"title": "Object"
},
{
"type": "array",
"title": "Array",
Expand All @@ -4210,7 +4214,8 @@
"description": "The ID of the node that data is expected to come from.",
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "object",
Expand All @@ -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",
Expand All @@ -4237,7 +4243,8 @@
"callback": {
"$ref": "#/components/schemas/process_graph"
}
}
},
"additionalProperties": false
}
]
},
Expand Down Expand Up @@ -4593,7 +4600,9 @@
"arguments": {
"$ref": "#/components/schemas/process_arguments"
},
"returns": {}
"returns": {
"nullable": true
}
}
}
},
Expand Down

0 comments on commit 64bfc62

Please sign in to comment.