APIFlask 2.3.0__tar.gz → 2.3.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.
- {apiflask-2.3.0 → apiflask-2.3.1}/CHANGES.md +9 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/PKG-INFO +1 -1
- {apiflask-2.3.0 → apiflask-2.3.1}/pyproject.toml +1 -1
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/PKG-INFO +1 -1
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/scaffold.py +11 -10
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_decorator_input.py +10 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/LICENSE +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/MANIFEST.in +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/NOTICE +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/README.md +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/README.md +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/auth/basic_auth/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/auth/token_auth/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/base_response/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/basic/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/blueprint_tags/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/cbv/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/dataclass/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/file_upload/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/file_upload/upload/.gitkeep +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/basic/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/custom_decorators/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/static_docs/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/static_docs/generate_docs.sh +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/static_docs/index.html +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/openapi/static_docs/openapi.json +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/orm/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/pagination/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/requirements.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/examples/test_examples.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/dev.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/docs.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/examples.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/min-versions.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/tests.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/requirements/typing.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/setup.cfg +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/SOURCES.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/dependency_links.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/entry_points.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/requires.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/APIFlask.egg-info/top_level.txt +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/__init__.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/blueprint.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/commands.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/exceptions.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/fields.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/helpers.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/openapi.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/py.typed +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/route.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/schemas.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/security.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/settings.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/types.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/ui_templates.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/validators.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/src/apiflask/views.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/__init__.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/conftest.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/schemas.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_app.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_apps/__init__.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_async.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_base_response.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_blueprint.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_commands.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_decorator_auth_required.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_decorator_doc.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_decorator_output.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_decorators.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_exceptions.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_fields.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_helpers.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_basic.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_blueprint.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_extensions.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_headers.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_info.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_paths.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_security.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_openapi_tags.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_route.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_schemas.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_security.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_settings_api_docs.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_settings_auto_behaviour.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_settings_openapi_fields.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_settings_openapi_spec.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tests/test_settings_response_customization.py +0 -0
- {apiflask-2.3.0 → apiflask-2.3.1}/tox.ini +0 -0
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## Version 2.3.1
|
|
2
|
+
|
|
3
|
+
Released: 2024/12/7
|
|
4
|
+
|
|
5
|
+
- Include input documentation in API spec when specifying `validation=False` on `@input` decorator ([issue #626][issue_626]).
|
|
6
|
+
|
|
7
|
+
[issue_626]: https://github.com/apiflask/apiflask/issues/626
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## Version 2.3.0
|
|
2
11
|
|
|
3
12
|
Released: 2024/11/25
|
|
@@ -4,7 +4,7 @@ description = "A lightweight web API framework based on Flask and marshmallow-co
|
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
license = { text = "MIT" }
|
|
6
6
|
authors = [{ name = "Grey Li", email = "withlihui@gmail.com" }]
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.1"
|
|
8
8
|
classifiers = [
|
|
9
9
|
"Development Status :: 3 - Alpha",
|
|
10
10
|
"Environment :: Web Environment",
|
|
@@ -338,16 +338,6 @@ class APIScaffold:
|
|
|
338
338
|
def decorator(f):
|
|
339
339
|
f = _ensure_sync(f)
|
|
340
340
|
|
|
341
|
-
if not validation:
|
|
342
|
-
|
|
343
|
-
@wraps(f)
|
|
344
|
-
def wrapper(*args: t.Any, **kwargs: t.Any):
|
|
345
|
-
raw_data = _load_raw_data(location)
|
|
346
|
-
kwargs[f'{location}_data'] = raw_data
|
|
347
|
-
return f(*args, **kwargs)
|
|
348
|
-
|
|
349
|
-
return wrapper
|
|
350
|
-
|
|
351
341
|
is_body_location = location in BODY_LOCATIONS
|
|
352
342
|
if is_body_location and hasattr(f, '_spec') and 'body' in f._spec:
|
|
353
343
|
raise RuntimeError(
|
|
@@ -394,6 +384,17 @@ class APIScaffold:
|
|
|
394
384
|
_annotate(f, omit_default_path_parameters=True)
|
|
395
385
|
# TODO: Support set example for request parameters
|
|
396
386
|
f._spec['args'].append((schema, location))
|
|
387
|
+
|
|
388
|
+
if not validation:
|
|
389
|
+
|
|
390
|
+
@wraps(f)
|
|
391
|
+
def wrapper(*args: t.Any, **kwargs: t.Any):
|
|
392
|
+
raw_data = _load_raw_data(location)
|
|
393
|
+
kwargs[f'{location}_data'] = raw_data
|
|
394
|
+
return f(*args, **kwargs)
|
|
395
|
+
|
|
396
|
+
return wrapper
|
|
397
|
+
|
|
397
398
|
return use_args(
|
|
398
399
|
schema, location=location, arg_name=arg_name or f'{location}_data', **kwargs
|
|
399
400
|
)(f)
|
|
@@ -435,6 +435,16 @@ def test_skip_validation(app, client):
|
|
|
435
435
|
assert no_validated_rv.json['json_data']['name'] == 'Kitty'
|
|
436
436
|
assert no_validated_rv.json['json_data']['category'] == 'unknown'
|
|
437
437
|
|
|
438
|
+
rv = client.get('/openapi.json')
|
|
439
|
+
assert rv.status_code == 200
|
|
440
|
+
assert (
|
|
441
|
+
rv.json['paths']['/pets_without_validation/{pet_id}']['patch']['requestBody']['content'][
|
|
442
|
+
'application/json'
|
|
443
|
+
]['schema']['$ref']
|
|
444
|
+
== '#/components/schemas/PetIn'
|
|
445
|
+
)
|
|
446
|
+
assert 'PetIn' in rv.json['components']['schemas']
|
|
447
|
+
|
|
438
448
|
|
|
439
449
|
def test_location_raw_data(app):
|
|
440
450
|
from apiflask.scaffold import _load_raw_data
|
|
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
|