PB-2354: OpenAPI: Group properties by extension - #662
Merged
asteiner-swisstopo merged 1 commit intoSep 7, 2026
Merged
Conversation
Changed the schema of "properties" to group the fields by STAC
extension:
- Core Properties
- created
- datetime
- start_datetime
- end_datetime
- updated
- title
- Timestamps extension
- expires
- Forecast extension
- forecast:reference_datetime
- forecast:horizon
- forecast:duration
- forecast:variable
- forecast:perturbed
- CF extension
- cf:standard_name
- unit
With the `anyOf`, SwaggerUI renders these groups into groups that can be
clicked. That should make the understanding easier.
On the other side, technically the OpenAPI specs are now incorrect: As
it is now, you could, for example, have this:
```json
{
"properties":
"expires": "2018-02-12T23:20:50Z"
}
```
while in fact some of the core properties are always mandatory and you
would rather have something like this:
```json
{
"properties":
"created": "2018-02-12T23:20:50Z",
"updated": "2018-02-12T23:20:50Z",
"datetime": "2018-02-12T23:20:50Z",
"expires": "2018-02-12T23:20:50Z",
}
```
Another sideeffect of this change is that the example payload only shows
the core properties, not all properties anymore:
```json
"properties": {
"created": "2018-02-12T23:20:50Z",
"updated": "2018-02-12T23:20:50Z",
"datetime": "2018-02-12T23:20:50Z",
"start_datetime": "2018-02-12T23:20:50Z",
"end_datetime": "2018-02-12T23:20:50Z",
"title": "Feature title"
},
```
We decided to still go with the incorrect OpenAPI schema because it
makes it more explicit.
boecklic
approved these changes
Aug 27, 2026
boecklic
left a comment
Contributor
There was a problem hiding this comment.
Not 100% ideal to have an "incorrect" spec, but I have no better idea right now, let's proceed with this.
asteiner-swisstopo
deleted the
feat-pb-2354-openapi-group-properties-by-extension
branch
September 7, 2026 09:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the schema of "properties" to group the fields by STAC extension:
With the
anyOf, SwaggerUI renders these groups into groups that can be clicked. That should make the understanding easier.On the other side, technically the OpenAPI specs are now incorrect: As it is now, you could, for example, have this:
{ "properties": "expires": "2018-02-12T23:20:50Z" }while in fact some of the core properties are always mandatory and you would rather have something like this:
{ "properties": "created": "2018-02-12T23:20:50Z", "updated": "2018-02-12T23:20:50Z", "datetime": "2018-02-12T23:20:50Z", "expires": "2018-02-12T23:20:50Z", }Another sideeffect of this change is that the example payload only shows the core properties, not all properties anymore:
We decided to still go with the incorrect OpenAPI schema because it makes it more explicit.