From 2091cd693bc03f6a71ecf7685df2be12172c7902 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Tue, 21 May 2024 06:26:21 +0200 Subject: [PATCH 1/3] Revert OpenAPI version number to 3.0.0 This was bumped in 8be2ec4e7b598c70111a30458ebe6d8e40d96abc 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 . Support for OpenAPI v3.1 is not offered by the current Legislation Explorer version and upgrading is too costly. See . --- openfisca_web_api/openAPI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openfisca_web_api/openAPI.yml b/openfisca_web_api/openAPI.yml index 5eb1d8cf5c..ce935e5596 100644 --- a/openfisca_web_api/openAPI.yml +++ b/openfisca_web_api/openAPI.yml @@ -1,4 +1,4 @@ -openapi: "3.1.0" +openapi: "3.0.0" info: title: "{COUNTRY_PACKAGE_NAME} Web API" @@ -137,8 +137,8 @@ components: type: "object" additionalProperties: $ref: "#/components/schemas/Value" - propertyNames: # this keyword is part of JSON Schema but is not supported in OpenAPI Specification at the time of writing, see https://swagger.io/docs/specification/data-models/keywords/#unsupported - pattern: "^[12][0-9]{3}-[01][0-9]-[0-3][0-9]$" # all keys are ISO dates + # 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 Value: oneOf: From de1b0fde9ccf932684b7f93d11da3dff5114fab4 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Tue, 21 May 2024 06:59:57 +0200 Subject: [PATCH 2/3] Test OpenAPI v3.0 compliance --- setup.py | 2 +- tests/web_api/test_spec.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bcedf5677d..fa6715c797 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ "idna >=3.4, < 4.0", "isort >=5.12.0, < 6.0", "mypy >=1.1.1, < 2.0", - "openapi-spec-validator >=0.5.6, < 0.6.0", + "openapi-spec-validator >=0.7.1, < 0.8.0", "pycodestyle >=2.10.0, < 3.0", "pylint >=2.17.1, < 3.0", "xdoctest >=1.1.1, < 2.0", diff --git a/tests/web_api/test_spec.py b/tests/web_api/test_spec.py index 89f221ee0e..228cf27eb8 100644 --- a/tests/web_api/test_spec.py +++ b/tests/web_api/test_spec.py @@ -3,7 +3,7 @@ import dpath.util import pytest -from openapi_spec_validator import openapi_v3_spec_validator +from openapi_spec_validator import OpenAPIV30SpecValidator def assert_items_equal(x, y): @@ -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()] From 1c655501c78763820b8952df3ff92c9f03d80c5d Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Tue, 21 May 2024 06:51:22 +0200 Subject: [PATCH 3/3] Bump version number --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 695ca11bc9..cf8f7d51de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 41.4.6 [#1210](https://github.com/openfisca/openfisca-core/pull/1210) + +#### Technical changes + +- Abide by OpenAPI v3.0.0 instead of v3.1.0 + - Drop support for `propertyNames` in `Values` definition + ### 41.4.5 [#1209](https://github.com/openfisca/openfisca-core/pull/1209) #### Technical changes diff --git a/setup.py b/setup.py index fa6715c797..cb41e7ec88 100644 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name="OpenFisca-Core", - version="41.4.5", + version="41.4.6", author="OpenFisca Team", author_email="contact@openfisca.org", classifiers=[