Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert OpenAPI version number to 3.0.0 #1210

Merged
merged 3 commits into from
May 21, 2024
Merged

Revert OpenAPI version number to 3.0.0 #1210

merged 3 commits into from
May 21, 2024

Conversation

MattiSG
Copy link
Member

@MattiSG MattiSG commented May 21, 2024

This was bumped in 8be2ec4 (#989). We do not actually abide by 3.1.0, as can be seen in the use of example instead of examples, support for which was dropped. v3.1.0 is indeed a breaking change, but the OpenAPI technical committee decided not to follow SemVer.

Support for OpenAPI v3.1 is not offered by the current Legislation Explorer version and upgrading is too costly (see openfisca/legislation-explorer#236).

Technical changes

  • Abide by OpenAPI v3.0.0 instead of v3.1.0
    • Drop support for propertyNames in Values definition

This was bumped in 8be2ec4 but we do not actually abide by 3.1.0, as can be seen in the use of `example` instead of `examples. v3.1.0 is a breaking change, the technical committee decided not to follow semver, see <https://github.com/OAI/OpenAPI-Specification/releases/tag/3.1.0-rc0>.
Support for OpenAPI v3.1 is not offered by the current Legislation Explorer version and upgrading is too costly. See <openfisca/legislation-explorer#236>.
@MattiSG MattiSG requested a review from verbman May 21, 2024 05:07
@coveralls
Copy link

Coverage Status

coverage: 74.48%. remained the same
when pulling 1c65550 on openapi3
into d5d287d on master.

@verbman verbman requested review from bonjourmauko and sandcha and removed request for verbman May 21, 2024 05:54
Copy link
Collaborator

@sandcha sandcha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix of the OpenAPI specification version!

@@ -62,4 +62,4 @@ def test_situation_definition(body):


def test_respects_spec(body):
assert not [error for error in openapi_v3_spec_validator.iter_errors(body)]
assert not [error for error in OpenAPIV30SpecValidator(body).iter_errors()]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Seen in this documentation (pdf). Also in the source code of openapi_spec_validator, OpenAPIV30SpecValidator and openapi_v3_spec_validator.

Comment on lines +140 to +141
# propertyNames: # this keyword is part of JSON Schema but is not supported in OpenAPI v3.0.0
# pattern: "^[12][0-9]{3}-[01][0-9]-[0-3][0-9]$" # all keys are ISO dates
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that we are dropping propertyNames because it wasn't and is not supported by OpenAPI and that we are keeping it here as documentation for humans.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is actually a revert of 8be2ec4: this was always documented this way and full JSON Schema support was added in OpenAPI v3.1. However, as documented in this PR and in 2091cd6, v3.1 needs a big Swagger UI update that we unfortunately cannot afford at the moment.

@MattiSG MattiSG merged commit 46c7c7e into master May 21, 2024
22 checks passed
@MattiSG MattiSG deleted the openapi3 branch May 21, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants