cadwyn 2.3.4__tar.gz → 2.3.5__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-2.3.4 → cadwyn-2.3.5}/PKG-INFO +1 -1
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/versions.py +10 -3
- {cadwyn-2.3.4 → cadwyn-2.3.5}/pyproject.toml +1 -1
- {cadwyn-2.3.4 → cadwyn-2.3.5}/setup.py +1 -1
- {cadwyn-2.3.4 → cadwyn-2.3.5}/LICENSE +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/README.md +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/__init__.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/__main__.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/_utils.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/codegen.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/exceptions.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/main.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/py.typed +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/routing.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/__init__.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/common.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/data.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/endpoints.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/enums.py +0 -0
- {cadwyn-2.3.4 → cadwyn-2.3.5}/cadwyn/structure/schemas.py +0 -0
|
@@ -447,9 +447,16 @@ class VersionBundle:
|
|
|
447
447
|
method,
|
|
448
448
|
)
|
|
449
449
|
if isinstance(response_or_response_body, FastapiResponse):
|
|
450
|
-
#
|
|
451
|
-
#
|
|
452
|
-
|
|
450
|
+
# a webserver (uvicorn for instance) calculates the body at the endpoint level.
|
|
451
|
+
# if an endpoint returns no "body", its content-length will be set to 0
|
|
452
|
+
# json.dums(None) results into "null", and content-length should be 4,
|
|
453
|
+
# but it was already calculated to 0 which causes
|
|
454
|
+
# `RuntimeError: Response content longer than Content-Length` or
|
|
455
|
+
# `Too much data for declared Content-Length`, based on the protocol
|
|
456
|
+
if response_info.body is not None:
|
|
457
|
+
# TODO: Give user the ability to specify their own renderer
|
|
458
|
+
# TODO: Only do this if there are migrations
|
|
459
|
+
response_info._response.body = json.dumps(response_info.body).encode()
|
|
453
460
|
return response_info._response
|
|
454
461
|
return response_info.body
|
|
455
462
|
|
|
@@ -21,7 +21,7 @@ entry_points = \
|
|
|
21
21
|
|
|
22
22
|
setup_kwargs = {
|
|
23
23
|
'name': 'cadwyn',
|
|
24
|
-
'version': '2.3.
|
|
24
|
+
'version': '2.3.5',
|
|
25
25
|
'description': 'Modern Stripe-like API versioning in FastAPI',
|
|
26
26
|
'long_description': '# Cadwyn\n\nModern [Stripe-like](https://stripe.com/blog/api-versioning) API versioning in FastAPI\n\n---\n\n<p align="center">\n<a href="https://github.com/zmievsa/cadwyn/actions?query=workflow%3ATests+event%3Apush+branch%3Amain" target="_blank">\n <img src="https://github.com/zmievsa/cadwyn/actions/workflows/test.yaml/badge.svg?branch=main&event=push" alt="Test">\n</a>\n<a href="https://codecov.io/gh/ovsyanka83/cadwyn" target="_blank">\n <img src="https://img.shields.io/codecov/c/github/ovsyanka83/cadwyn?color=%2334D058" alt="Coverage">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img alt="PyPI" src="https://img.shields.io/pypi/v/cadwyn?color=%2334D058&label=pypi%20package" alt="Package version">\n</a>\n<a href="https://pypi.org/project/cadwyn/" target="_blank">\n <img src="https://img.shields.io/pypi/pyversions/cadwyn?color=%2334D058" alt="Supported Python versions">\n</a>\n</p>\n\n## Who is this for?\n\nCadwyn allows you to support a single version of your code, auto-generating the code/routes for older versions. You keep versioning encapsulated in small and independent "version change" modules while your business logic knows nothing about versioning.\n\nIts [approach](./docs/theory.md#ii-migration-based-response-building) will be useful if you want to:\n\n1. Support many (>2) API versions for a long time\n2. Effortlessly backport features and bugfixes to older API versions\n\n## Get started\n\nThe [documentation](https://docs.cadwyn.dev) has everything you need to get started. It is recommended to read it in the following order:\n\n1. [Tutorial](./tutorial.md)\n2. [Recipes](./recipes.md)\n3. [Reference](./reference.md)\n4. [Theory](./theory.md) <!-- TODO: Move section about cadwyn\'s approach to the beginning and move other approaches and "how we got here" to another article -->\n\n## Similar projects\n\nThe following projects are trying to accomplish similar results with a lot more simplistic functionality.\n\n- <https://github.com/sjkaliski/pinned>\n- <https://github.com/phillbaker/gates>\n- <https://github.com/lukepolo/laravel-api-migrations>\n- <https://github.com/tomschlick/request-migrations>\n- <https://github.com/keygen-sh/request_migrations>\n',
|
|
27
27
|
'author': 'Stanislav Zmiev',
|
|
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
|