cadwyn 5.1.0__tar.gz → 5.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cadwyn might be problematic. Click here for more details.
- {cadwyn-5.1.0 → cadwyn-5.1.1}/CHANGELOG.md +6 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/PKG-INFO +1 -1
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/schema_generation.py +13 -3
- {cadwyn-5.1.0 → cadwyn-5.1.1}/pyproject.toml +1 -1
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_router_generation_with_from_future_annotations.py +7 -3
- cadwyn-5.1.1/tests/test_schema_generation/test_schema_with_future_annotations.py +38 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/uv.lock +1 -1
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/CODE_OF_CONDUCT.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/actions/setup-python-uv/action.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/workflows/ci.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/workflows/daily_tests.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/workflows/publish_docs.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.github/workflows/release.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.gitignore +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/.pre-commit-config.yaml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/LICENSE +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/Makefile +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/README.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/__main__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/_asts.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/_importer.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/_render.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/_utils.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/applications.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/changelogs.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/exceptions.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/middleware.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/py.typed +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/route_generation.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/routing.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/static/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/static/docs.html +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/common.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/data.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/endpoints.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/enums.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/schemas.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/cadwyn/structure/versions.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/CNAME +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/api_version_parameter_and_context_variables.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/beware_of_data_versioning.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/changelogs.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/cli.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/endpoint_migrations.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/enum_migrations.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/index.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/main_app.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/methodology.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/schema_generation.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/schema_migrations.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/testing.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/version_changes.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/where_to_put_the_version_and_how_to_format_it.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/home/CONTRIBUTING.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_business_logic/index.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_endpoints/index.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/add_field.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/change_field_type.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/change_schema_without_endpoint.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/changing_constraints.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/remove_field.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/rename_a_field_in_schema.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/index.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/version_with_paths_and_numbers_instead_of_headers_and_dates.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/dashboard_with_one_version.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/dashboard_with_two_versions.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/get_users_endpoint_from_prior_version.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/simplified_migration_model.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/sponsor_logos/monite.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/img/unversioned_dashboard.png +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/index.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/plugin.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/quickstart/setup.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/quickstart/tutorial.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/theory/how_to_build_versioning_framework.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/theory/how_we_got_here.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs/theory/literature.md +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/block001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/tests/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/tests/test_block001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/change_openapi_schemas/change_schema_without_endpoint/tests/test_block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/version_with_path_and_numbers_instead_of_headers_and_dates/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/version_with_path_and_numbers_instead_of_headers_and_dates/block001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/version_with_path_and_numbers_instead_of_headers_and_dates/tests/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/how_to/version_with_path_and_numbers_instead_of_headers_and_dates/tests/test_block_001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/setup/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/setup/block001.sh +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/setup/block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/setup/tests/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/setup/tests/test_block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/block001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/block003.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/tests/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/tests/test_block001.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/tests/test_block002.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/quickstart/tutorial/tests/test_block003.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/docs_src/ruff.toml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/mkdocs.yml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/ruff.toml +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/scripts/fix_links.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/scripts/split_md.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_data/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_data/unversioned_schema_dir/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_data/unversioned_schema_dir/unversioned_schemas.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_data/unversioned_schemas.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/app_for_testing_routing.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/classes.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/complex/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/complex/classes.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/complex/versions.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/render/versions.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/utils.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/versioned_app/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/versioned_app/app.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/versioned_app/v2021_01_01.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/versioned_app/v2022_01_02.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/_resources/versioned_app/webhooks.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/conftest.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_applications.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_auth_dependencies.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_changelog.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_cli.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_data_migrations.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_render.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_router_generation.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_routing.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_schema_generation/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_schema_generation/test_enum.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_schema_generation/test_schema.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_schema_generation/test_schema_field.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_schema_generation/test_schema_validator.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/test_structure.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/tutorial/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/tutorial/main.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/tutorial/test_example.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/versioning_styles/__init__.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tests/versioning_styles/test_versioning_formats.py +0 -0
- {cadwyn-5.1.0 → cadwyn-5.1.1}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cadwyn
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.1
|
|
4
4
|
Summary: Production-ready community-driven modern Stripe-like API versioning in FastAPI
|
|
5
5
|
Project-URL: Source code, https://github.com/zmievsa/cadwyn
|
|
6
6
|
Project-URL: Documentation, https://docs.cadwyn.dev
|
|
@@ -264,10 +264,20 @@ def _wrap_pydantic_model(model: type[_T_PYDANTIC_MODEL]) -> "_PydanticModelWrapp
|
|
|
264
264
|
|
|
265
265
|
wrapped_validator = _wrap_validator(decorator_wrapper.func, decorator_wrapper.shim, decorator_wrapper.info)
|
|
266
266
|
validators[decorator_wrapper.cls_var_name] = wrapped_validator
|
|
267
|
+
|
|
268
|
+
def _rebuild_annotated(name: str):
|
|
269
|
+
if field_info := model.model_fields.get(name):
|
|
270
|
+
if not field_info.metadata:
|
|
271
|
+
return field_info.annotation
|
|
272
|
+
|
|
273
|
+
if sys.version_info >= (3, 13):
|
|
274
|
+
return Annotated.__getitem__((field_info.annotation, *field_info.metadata)) # pyright: ignore[reportAttributeAccessIssue]
|
|
275
|
+
else:
|
|
276
|
+
return Annotated.__class_getitem__((field_info.annotation, *field_info.metadata)) # pyright: ignore[reportAttributeAccessIssue]
|
|
277
|
+
return model.__annotations__[name] # pragma: no cover
|
|
278
|
+
|
|
267
279
|
annotations = {
|
|
268
|
-
name: value
|
|
269
|
-
if not isinstance(value, str)
|
|
270
|
-
else model.model_fields[name].annotation or model.__annotations__[name]
|
|
280
|
+
name: value if not isinstance(value, str) else _rebuild_annotated(name)
|
|
271
281
|
for name, value in model.__annotations__.items()
|
|
272
282
|
}
|
|
273
283
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
3
5
|
from fastapi.testclient import TestClient
|
|
4
|
-
from pydantic import BaseModel, Field
|
|
6
|
+
from pydantic import BaseModel, Field, WithJsonSchema
|
|
5
7
|
|
|
6
8
|
from cadwyn.applications import Cadwyn
|
|
7
9
|
from cadwyn.route_generation import VersionedAPIRouter
|
|
@@ -12,6 +14,8 @@ from cadwyn.structure.versions import Version, VersionBundle, VersionChange
|
|
|
12
14
|
class OuterSchema(BaseModel):
|
|
13
15
|
bar: MySchema
|
|
14
16
|
|
|
17
|
+
extra_annotated: Annotated[str, WithJsonSchema({"type": "string", "description": "Hello"})] = ""
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
class MySchema(BaseModel):
|
|
17
21
|
foo: str = Field(coerce_numbers_to_str=True)
|
|
@@ -56,7 +60,7 @@ def test__router_generation__using_forwardref_outer_global_schema_in_body():
|
|
|
56
60
|
unversioned_client = TestClient(app)
|
|
57
61
|
client_2000 = TestClient(app, headers={app.router.api_version_parameter_name: "2000-01-01"})
|
|
58
62
|
client_2001 = TestClient(app, headers={app.router.api_version_parameter_name: "2001-01-01"})
|
|
59
|
-
assert client_2000.post("/test2", json={"bar": {"foo": 1}}).json() == {"bar": {"foo": 1}}
|
|
60
|
-
assert client_2001.post("/test2", json={"bar": {"foo": 1}}).json() == {"bar": {"foo": "1"}}
|
|
63
|
+
assert client_2000.post("/test2", json={"bar": {"foo": 1}}).json() == {"bar": {"foo": 1}, "extra_annotated": ""}
|
|
64
|
+
assert client_2001.post("/test2", json={"bar": {"foo": 1}}).json() == {"bar": {"foo": "1"}, "extra_annotated": ""}
|
|
61
65
|
assert unversioned_client.get("/openapi.json?version=2000-01-01").status_code == 200
|
|
62
66
|
assert unversioned_client.get("/openapi.json?version=2001-01-01").status_code == 200
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from typing import Annotated
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
from pydantic import BaseModel, WithJsonSchema
|
|
8
|
+
from typing_extensions import TypeAlias
|
|
9
|
+
|
|
10
|
+
from cadwyn.exceptions import InvalidGenerationInstructionError
|
|
11
|
+
from cadwyn.structure.schemas import schema
|
|
12
|
+
from tests.conftest import CreateRuntimeSchemas, assert_models_are_equal, version_change
|
|
13
|
+
|
|
14
|
+
Foo: TypeAlias = int
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class MySchema(BaseModel):
|
|
18
|
+
foo: Foo
|
|
19
|
+
bar: Annotated[str, WithJsonSchema({"type": "string", "description": "Hi"})]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test__schema_had_name(create_runtime_schemas: CreateRuntimeSchemas):
|
|
23
|
+
schemas = create_runtime_schemas(version_change(schema(MySchema).had(name="Aww")))
|
|
24
|
+
|
|
25
|
+
assert_models_are_equal(schemas["2000-01-01"][MySchema], MySchema)
|
|
26
|
+
assert schemas["2000-01-01"][MySchema].__name__ == "Aww"
|
|
27
|
+
assert schemas["2000-01-01"][MySchema].__qualname__ == "Aww"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test__schema_had_name__with_the_same_name__should_raise_error(create_runtime_schemas: CreateRuntimeSchemas):
|
|
31
|
+
with pytest.raises(
|
|
32
|
+
InvalidGenerationInstructionError,
|
|
33
|
+
match=re.escape(
|
|
34
|
+
'You tried to change the name of "MySchema" in "MyVersionChange" '
|
|
35
|
+
"but it already has the name you tried to assign."
|
|
36
|
+
),
|
|
37
|
+
):
|
|
38
|
+
create_runtime_schemas(version_change(schema(MySchema).had(name="MySchema")))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cadwyn-5.1.0 → cadwyn-5.1.1}/docs/concepts/where_to_put_the_version_and_how_to_format_it.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/change_schema_without_endpoint.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cadwyn-5.1.0 → cadwyn-5.1.1}/docs/how_to/change_openapi_schemas/rename_a_field_in_schema.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|