From 962ab7789efa4af28efed53ecf38b33af1a8800a Mon Sep 17 00:00:00 2001 From: dphuang2 Date: Tue, 31 Oct 2023 22:44:32 -0700 Subject: [PATCH] [ENG-1067] Use Dataclasses in Python instead of TypedDict for return values (#323) * save * docs(changeset): update description of pythonResponseType * _raw * implement pydantic response type * rename to python-pydantic-responses * generating pydantic files now TODO: fix pydantic models to make test pass * test working for pydantic responses * regenerate SDKs w/ updated generator * add type hint dependencies to pydantic file * python-pydantic-responses working * fix leap-workflows-sdks * regenerate all integration test SDKs * fix setup.py in Python SDK * regenerate e2e SDKs * fix duplicate key from license * fix duplicate key from license * rename configurations to pydantic in python-pydantic-responses test * add test_typed_dict_response * test works with class_ and two tags * fix handling of reserved word + multiple tags * handle prstv1 * regenerate e2e sdks * disable generation of pydantic classes if prstv1 * regenerate e2e SDKs run-it --- .../.changeset/mighty-laws-applaud.md | 5 + .../packages/konfig-lib/src/KonfigYaml.ts | 2 +- .../openapitools/codegen/CodegenConfig.java | 8 + .../openapitools/codegen/CodegenModel.java | 5 + .../codegen/CodegenOperation.java | 1 + .../openapitools/codegen/CodegenProperty.java | 2 + .../openapitools/codegen/DefaultCodegen.java | 24 ++ .../codegen/DefaultGenerator.java | 18 +- .../languages/AbstractPythonCodegen.java | 4 + .../languages/PythonClientCodegen.java | 57 +++- .../codegen/model/PythonDependency.java | 25 ++ .../python/__init__pydantic.handlebars} | 0 .../src/main/resources/python/api.handlebars | 11 + .../main/resources/python/api_raw.handlebars | 22 ++ .../main/resources/python/endpoint.handlebars | 15 +- .../resources/python/endpoint_args.handlebars | 5 + .../python/endpoint_pydantic_impl.handlebars | 19 ++ .../resources/python/poetry.lock.handlebars | 153 ++++++++- .../main/resources/python/pydantic.handlebars | 19 ++ .../python/pydantic_templates/type.handlebars | 6 + .../type_composed.handlebars | 13 + .../pydantic_templates/type_enum.handlebars | 3 + .../pydantic_templates/type_list.handlebars | 3 + .../pydantic_templates/type_map.handlebars | 5 + .../pydantic_templates/type_object.handlebars | 26 ++ .../type_primitive.handlebars | 5 + .../type_property_name.handlebars | 1 + .../resources/python/pyproject.handlebars | 8 +- .../main/resources/python/setup.handlebars | 7 +- .../leap_workflows/pydantic}/__init__.py | 0 .../sdks/python/poetry.lock | 153 ++++++++- .../sdks/python/pyproject.toml | 1 + .../leap-workflows-sdks/sdks/python/setup.py | 12 +- .../sdks/python-dataclass-responses/README.md | 5 - .../python/.konfigignore | 1 - .../python_dataclass_responses/__init__.py | 31 -- .../apis/path_to_api.py | 17 - .../apis/paths/simple_endpoint.py | 7 - .../apis/tags/test_api.py | 22 -- .../models/__init__.py | 16 - .../python/test/test_dataclass_response.py | 28 -- .../.konfig/progress.yaml | 0 .../.konfig/ruleset-version | 0 .../.konfig/ruleset.js | 0 .../.spectral.yaml | 0 .../.vscode/extensions.json | 0 .../.vscode/settings.json | 0 .../LICENSE | 0 .../sdks/python-pydantic-responses/README.md | 5 + .../api.yaml | 25 +- .../konfig.yaml | 8 +- .../python/.gitignore | 0 .../python/.konfigignore | 1 + .../python/.vscode/settings.json | 0 .../python/LICENSE | 0 .../python/README.md | 51 ++- .../python/poetry.lock | 153 ++++++++- .../python/pyproject.toml | 7 +- .../python/python_pydantic/__init__.py | 31 ++ .../python/python_pydantic}/api_client.py | 20 +- .../python/python_pydantic}/api_response.py | 0 .../python/python_pydantic}/apis/__init__.py | 0 .../python_pydantic/apis/path_to_api.py | 20 ++ .../python_pydantic}/apis/paths/__init__.py | 2 +- .../apis/paths/reserved_word.py | 7 + .../apis/paths/simple_endpoint.py | 7 + .../python_pydantic}/apis/tag_to_api.py | 4 +- .../python_pydantic}/apis/tags/__init__.py | 2 +- .../python_pydantic/apis/tags/test_api.py | 29 ++ .../python_pydantic/apis/tags/test_api_raw.py | 24 ++ .../python/python_pydantic}/client.py | 16 +- .../python/python_pydantic}/client.pyi | 16 +- .../python/python_pydantic}/client_custom.py | 8 +- .../python/python_pydantic}/configuration.py | 18 +- .../python/python_pydantic}/exceptions.py | 8 +- .../python_pydantic}/exceptions_base.py | 0 .../python/python_pydantic}/model/__init__.py | 2 +- .../model/test_fetch400_response.py | 6 +- .../model/test_fetch400_response.pyi | 6 +- .../model/test_fetch500_response.py | 6 +- .../model/test_fetch500_response.pyi | 6 +- .../model/test_fetch_response.py | 6 +- .../model/test_fetch_response.pyi | 6 +- .../model/test_reserved_word.py | 75 +++++ .../model/test_reserved_word.pyi | 75 +++++ .../python/python_pydantic/models/__init__.py | 17 + .../python/python_pydantic}/paths/__init__.py | 3 +- .../paths/reserved_word/__init__.py | 7 + .../paths/reserved_word/get.py | 314 ++++++++++++++++++ .../paths/reserved_word/get.pyi | 306 +++++++++++++++++ .../paths/simple_endpoint/__init__.py | 4 +- .../paths/simple_endpoint/get.py | 57 +++- .../paths/simple_endpoint/get.pyi | 57 +++- .../python_pydantic/pydantic}/__init__.py | 0 .../pydantic/test_fetch400_response.py | 21 ++ .../pydantic/test_fetch500_response.py | 21 ++ .../pydantic/test_fetch_response.py | 28 ++ .../pydantic/test_reserved_word.py | 22 ++ .../python_pydantic}/request_after_hook.py | 6 +- .../python_pydantic}/request_before_hook.py | 6 +- .../request_before_url_hook.py | 6 +- .../python/python_pydantic}/rest.py | 6 +- .../python/python_pydantic}/schemas.py | 18 +- .../python/python_pydantic/type}/__init__.py | 0 .../type/test_fetch400_response.py | 4 +- .../type/test_fetch500_response.py | 4 +- .../type/test_fetch_response.py | 4 +- .../type/test_reserved_word.py | 28 ++ .../python/python_pydantic}/type_util.py | 4 +- .../python_pydantic}/validation_metadata.py | 2 +- .../python/setup.cfg | 0 .../python/setup.py | 21 +- .../python/test/__init__.py | 0 .../python/test/test_check_url.py | 8 +- .../python/test/test_deprecation_warning.py | 4 +- .../python/test/test_models/__init__.py | 0 .../test_test_fetch400_response.py | 10 +- .../test_test_fetch500_response.py | 10 +- .../test_models/test_test_fetch_response.py | 10 +- .../test_models/test_test_reserved_word.py | 26 ++ .../python/test/test_paths/__init__.py | 0 .../test_paths/test_reserved_word/__init__.py | 0 .../test_paths/test_reserved_word/test_get.py | 42 +++ .../test_simple_endpoint/__init__.py | 0 .../test_simple_endpoint/test_get.py | 10 +- .../python/test/test_pydantic_response.py | 48 +++ .../python/test/test_simple.py | 10 +- .../python/.konfigignore | 1 + .../python/poetry.lock | 153 ++++++++- .../python/pyproject.toml | 1 + .../python_typeddict/pydantic/__init__.py | 0 .../python/setup.py | 11 +- .../python/test/test_typed_dict_response.py | 25 ++ ...=> python-pydantic-responses.test.ts.snap} | 53 ++- ...t.ts => python-pydantic-responses.test.ts} | 2 +- 135 files changed, 2439 insertions(+), 366 deletions(-) create mode 100644 generator/konfig-dash/.changeset/mighty-laws-applaud.md create mode 100644 generator/konfig-generator-api/src/main/java/org/openapitools/codegen/model/PythonDependency.java rename generator/{konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/__init__.py => konfig-generator-api/src/main/resources/python/__init__pydantic.handlebars} (100%) create mode 100644 generator/konfig-generator-api/src/main/resources/python/api_raw.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/endpoint_pydantic_impl.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_composed.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_enum.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_list.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_map.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_object.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_primitive.handlebars create mode 100644 generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_property_name.handlebars rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/test => leap-workflows-sdks/sdks/python/leap_workflows/pydantic}/__init__.py (100%) delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/README.md delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.konfigignore delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/__init__.py delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/path_to_api.py delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/simple_endpoint.py delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/test_api.py delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/models/__init__.py delete mode 100644 generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_dataclass_response.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.konfig/progress.yaml (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.konfig/ruleset-version (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.konfig/ruleset.js (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.spectral.yaml (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.vscode/extensions.json (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/.vscode/settings.json (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/LICENSE (100%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/README.md rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/api.yaml (76%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/konfig.yaml (56%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/.gitignore (100%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.konfigignore rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/.vscode/settings.json (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/LICENSE (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/README.md (70%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/poetry.lock (87%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/pyproject.toml (78%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/__init__.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/api_client.py (99%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/api_response.py (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/apis/__init__.py (100%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/path_to_api.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/apis/paths/__init__.py (72%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/reserved_word.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/simple_endpoint.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/apis/tag_to_api.py (61%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/apis/tags/__init__.py (78%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api_raw.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/client.py (57%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/client.pyi (57%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/client_custom.py (72%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/configuration.py (96%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/exceptions.py (96%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/exceptions_base.py (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/__init__.py (82%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch400_response.py (93%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch400_response.pyi (93%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch500_response.py (93%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch500_response.pyi (93%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch_response.py (95%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/model/test_fetch_response.pyi (95%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.pyi create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/models/__init__.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/paths/__init__.py (74%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/__init__.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.pyi rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/paths/simple_endpoint/__init__.py (63%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/paths/simple_endpoint/get.py (87%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/paths/simple_endpoint/get.pyi (87%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/test/test_models => python-pydantic-responses/python/python_pydantic/pydantic}/__init__.py (100%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch400_response.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch500_response.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch_response.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_reserved_word.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/request_after_hook.py (78%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/request_before_hook.py (78%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/request_before_url_hook.py (79%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/rest.py (98%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/schemas.py (99%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/test/test_paths/test_simple_endpoint => python-pydantic-responses/python/python_pydantic/type}/__init__.py (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/type/test_fetch400_response.py (84%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/type/test_fetch500_response.py (84%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/type/test_fetch_response.py (87%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_reserved_word.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/type_util.py (84%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses/python/python_dataclass_responses => python-pydantic-responses/python/python_pydantic}/validation_metadata.py (98%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/setup.cfg (100%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/setup.py (75%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/__init__.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_check_url.py (91%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_deprecation_warning.py (90%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/__init__.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_models/test_test_fetch400_response.py (55%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_models/test_test_fetch500_response.py (55%) rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_models/test_test_fetch_response.py (55%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_reserved_word.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_paths/__init__.py (100%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/__init__.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/test_get.py create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/__init__.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_paths/test_simple_endpoint/test_get.py (68%) create mode 100644 generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_pydantic_response.py rename generator/konfig-integration-tests/sdks/{python-dataclass-responses => python-pydantic-responses}/python/test/test_simple.py (62%) create mode 100644 generator/konfig-integration-tests/sdks/python-typeddict-responses/python/.konfigignore create mode 100644 generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/pydantic/__init__.py create mode 100644 generator/konfig-integration-tests/sdks/python-typeddict-responses/python/test/test_typed_dict_response.py rename generator/konfig-integration-tests/tests/__snapshots__/{python-dataclass-responses.test.ts.snap => python-pydantic-responses.test.ts.snap} (68%) rename generator/konfig-integration-tests/tests/{python-dataclass-responses.test.ts => python-pydantic-responses.test.ts} (52%) diff --git a/generator/konfig-dash/.changeset/mighty-laws-applaud.md b/generator/konfig-dash/.changeset/mighty-laws-applaud.md new file mode 100644 index 000000000..baef235a9 --- /dev/null +++ b/generator/konfig-dash/.changeset/mighty-laws-applaud.md @@ -0,0 +1,5 @@ +--- +'konfig-lib': minor +--- + +update description of pythonResponseType diff --git a/generator/konfig-dash/packages/konfig-lib/src/KonfigYaml.ts b/generator/konfig-dash/packages/konfig-lib/src/KonfigYaml.ts index 72042eed9..040499a7d 100644 --- a/generator/konfig-dash/packages/konfig-lib/src/KonfigYaml.ts +++ b/generator/konfig-dash/packages/konfig-lib/src/KonfigYaml.ts @@ -188,7 +188,7 @@ const pythonResponseTypeVersion1 = z const pythonResponseTypeVersion2 = z .literal('2') .describe( - 'Responses are DataClass instances and do not include all HTTP response fields in the response object. To get raw HTTP repsonse fields, use the _with_http_info version of the method.' + 'Responses are Pydantic instances and do not include all HTTP response fields in the response object. To get raw HTTP repsonse fields, use the .raw.[method] version of the method.' ) export const pythonResponseTypeVersion = z diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenConfig.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenConfig.java index 097205b2a..d75230ee0 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -78,6 +78,8 @@ public interface CodegenConfig { String typeFileFolder(); + String additionalModelFileFolder(); + String modelTestFileFolder(); String modelDocFileFolder(); @@ -86,6 +88,8 @@ public interface CodegenConfig { String typePackage(); + String additionalModelPackage(); + String toApiName(String name); String toApiVarName(String name); @@ -160,6 +164,8 @@ public interface CodegenConfig { Map typeTemplateFiles(); + Map additionalModelTemplateFiles(); + Map apiTestTemplateFiles(); Map modelTestTemplateFiles(); @@ -224,6 +230,8 @@ public interface CodegenConfig { String typeFilename(String templateName, String modelName); + String additionalModelFilename(String templateName, String modelName); + String apiFilename(String templateName, String tag); String apiTestFilename(String templateName, String tag); diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenModel.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenModel.java index c5d41f5c3..cd760a3eb 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -92,6 +92,11 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public Set imports = new TreeSet<>(); public Set typeImports = new TreeSet<>(); + public Set additionalModelImports = new TreeSet<>(); + + // In Python, we need a modified version of Import without the "as [Model]Pydantic" suffix so I added this + public Set additionalModelImportsModified = new TreeSet<>(); + public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation; /** * Indicates the OAS schema specifies "nullable: true". diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenOperation.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenOperation.java index 6dbc13c38..62eaa6238 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -76,6 +76,7 @@ public class CodegenOperation { // type imports public Set schemaImports = new HashSet(); public Set typeImports = new HashSet(); + public Set additionalModelImports = new HashSet(); public List> examples; public List> requestBodyExamples; public ExternalDocumentation externalDocs; diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenProperty.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenProperty.java index fc71793db..6f397c29e 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -53,6 +53,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti * The name of this property in the OpenAPI schema. */ public String name; + public boolean hasProblematicName = false; public String min; // TODO: is this really used? public String max; // TODO: is this really used? public String defaultValue; @@ -185,6 +186,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public String nameInCamelCase; // property name in camel case public String nameInCamelCaseLowerFirst; // property name in camel case with lowercase first character public String nameInSnakeCase; // property name in upper snake case + public String nameInSnakeCaseLower; // property name in lower snake case // enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1) public String enumName; public Integer maxItems; diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultCodegen.java index b201fdbe8..604c109ac 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -181,6 +181,7 @@ public class DefaultCodegen implements CodegenConfig { protected Map inlineSchemaNameDefault = new HashMap<>(); protected String modelPackage = "", apiPackage = "", fileSuffix; protected String typePackage = ""; + protected String additionalModelPackage = ""; protected String modelNamePrefix = "", modelNameSuffix = ""; protected String apiNamePrefix = "", apiNameSuffix = "Api"; protected String testPackage = ""; @@ -194,6 +195,7 @@ public class DefaultCodegen implements CodegenConfig { protected Map apiTemplateFiles = new HashMap<>(); protected Map modelTemplateFiles = new HashMap<>(); protected Map typeTemplateFiles = new HashMap<>(); + protected Map additionalModelTemplateFiles = new HashMap<>(); protected Map apiTestTemplateFiles = new HashMap<>(); protected Map modelTestTemplateFiles = new HashMap<>(); protected Map apiDocTemplateFiles = new HashMap<>(); @@ -1177,6 +1179,11 @@ public String typePackage() { return typePackage; } + @Override + public String additionalModelPackage() { + return additionalModelPackage; + } + @Override public String apiPackage() { return apiPackage; @@ -1241,6 +1248,11 @@ public Map typeTemplateFiles() { return typeTemplateFiles; } + @Override + public Map additionalModelTemplateFiles() { + return additionalModelTemplateFiles; + } + @Override public String apiFileFolder() { return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); @@ -1256,6 +1268,11 @@ public String typeFileFolder() { return outputFolder + File.separator + typePackage().replace('.', File.separatorChar); } + @Override + public String additionalModelFileFolder() { + return outputFolder + File.separator + additionalModelPackage().replace('.', File.separatorChar); + } + @Override public String apiTestFileFolder() { return outputFolder + File.separator + testPackage().replace('.', File.separatorChar); @@ -3924,6 +3941,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, property.nameInCamelCase = camelize(property.name); property.nameInCamelCaseLowerFirst = camelize(property.name, CamelizeOption.LOWERCASE_FIRST_LETTER); property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase); + property.nameInSnakeCaseLower = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, property.baseName); property.description = escapeText(p.getDescription()); property.unescapedDescription = p.getDescription(); property.title = p.getTitle(); @@ -6172,6 +6190,12 @@ public String typeFilename(String templateName, String modelName) { return typeFileFolder() + File.separator + toModelFilename(modelName) + suffix; } + @Override + public String additionalModelFilename(String templateName, String modelName) { + String suffix = additionalModelTemplateFiles().get(templateName); + return additionalModelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } + /** * Return the full path and API documentation file * diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 1758ff502..cdf15b432 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -413,7 +413,20 @@ private void generateType(List files, Map models, String m if (written != null) { files.add(written); if (config.isEnablePostProcessFile() && !dryRun) { - config.postProcessFile(written, "model"); + config.postProcessFile(written, "type"); + } + } + } + } + + private void generateAdditionalModel(List files, Map models, String modelName) throws IOException { + for (String templateName : config.additionalModelTemplateFiles().keySet()) { + String filename = config.additionalModelFilename(templateName, modelName); + File written = processTemplateToFile(models, templateName, filename, generateModels, CodegenConstants.MODELS); + if (written != null) { + files.add(written); + if (config.isEnablePostProcessFile() && !dryRun) { + config.postProcessFile(written, "additionalModel"); } } } @@ -571,6 +584,9 @@ void generateModels(List files, List allModels, List unu // to generate type files generateType(files, models, modelName); + // to generate additional files for model (in Python, this is used for Pydantic models) + generateAdditionalModel(files, models, modelName); + // to generate model test files generateModelTests(files, models, modelName); diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index d08a33117..0bc29d99b 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -691,6 +691,10 @@ public String toApiFilename(String name) { return underscore(toApiName(name)); } + public String toApiFilenameRaw(String name) { + return toApiFilename(name) + "_raw"; + } + @Override public String toClientApiName(String name) { return underscore(name); diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 61198a527..f821996e7 100644 --- a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -33,6 +33,8 @@ import io.swagger.v3.oas.models.tags.Tag; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.text.StringEscapeUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.CodegenDiscriminator.MappedModel; @@ -43,10 +45,7 @@ import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.model.ModelMap; -import org.openapitools.codegen.model.ModelsMap; -import org.openapitools.codegen.model.OperationMap; -import org.openapitools.codegen.model.OperationsMap; +import org.openapitools.codegen.model.*; import org.openapitools.codegen.templating.CommonTemplateContentLocator; import org.openapitools.codegen.templating.GeneratorTemplateContentLocator; import org.openapitools.codegen.templating.HandlebarsEngineAdapter; @@ -172,6 +171,7 @@ public PythonClientCodegen() { modelPackage = "model"; typePackage = "type"; + additionalModelPackage = "pydantic"; apiPackage = "apis"; outputFolder = "generated-code" + File.separatorChar + "python"; @@ -182,6 +182,25 @@ public PythonClientCodegen() { // default HIDE_GENERATION_TIMESTAMP to true hideGenerationTimestamp = Boolean.TRUE; + ArrayList dependencies = new ArrayList<>(); + dependencies.add(new PythonDependency("certifi", "2023.7.22", ">=", ">=")); + dependencies.add(new PythonDependency("python-dateutil", "2.8.2", "~=", "^")); + dependencies.add(new PythonDependency("typing_extensions", "4.3.0", "~=", "^")); + dependencies.add(new PythonDependency("urllib3", "1.26.18", "~=", "^")); + dependencies.add(new PythonDependency("frozendict", "2.3.4", "~=", "^")); + dependencies.add(new PythonDependency("aiohttp", "3.8.4", "~=", "^")); + dependencies.add(new PythonDependency("pydantic", "2.4.2", "~=", "^")); + ArrayList poetryDependencies = new ArrayList<>(); + poetryDependencies.add(new PythonDependency("python", "3.7", "N/A", "^")); + poetryDependencies.addAll(dependencies); + + + // join dependencies with newline + additionalProperties.put("poetryDependencies", String.join("\n", poetryDependencies.stream().map(PythonDependency::poetry).collect(Collectors.toList()))); + + // join dependencies with ",\n" + additionalProperties.put("setupRequirements", String.join(",\n ", dependencies.stream().map(PythonDependency::setupPy).collect(Collectors.toList()))); + // from https://docs.python.org/3/reference/lexical_analysis.html#keywords setReservedWordsLowerCase( Arrays.asList( @@ -313,6 +332,10 @@ public void processOpts() { typeTemplateFiles.put("type." + templateExtension, ".py"); apiTemplateFiles.put("api." + templateExtension, ".py"); + if (additionalProperties.get("prstv2") != null && additionalProperties.get("prstv2").equals(true)) { + additionalModelTemplateFiles.put("pydantic." + templateExtension, ".py"); + apiTemplateFiles.put("api_raw." + templateExtension, ".py"); + } modelTestTemplateFiles.put("model_test." + templateExtension, ".py"); // Commented these out as we now generate all docs in the top-level Python SDK's README.md @@ -469,6 +492,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("__init__models." + templateExtension, packagePath() + File.separatorChar + "models", "__init__.py")); supportingFiles.add(new SupportingFile("__init__model." + templateExtension, packagePath() + File.separatorChar + modelPackage, "__init__.py")); supportingFiles.add(new SupportingFile("__init__type." + templateExtension, packagePath() + File.separatorChar + typePackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__pydantic." + templateExtension, packagePath() + File.separatorChar + additionalModelPackage, "__init__.py")); supportingFiles.add(new SupportingFile("__init__apis." + templateExtension, packagePath() + File.separatorChar + apiPackage, "__init__.py")); // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. Map securitySchemeMap = openAPI != null ? @@ -524,7 +548,8 @@ protected File processTemplateToFile(Map templateData, String te @Override public String apiFilename(String templateName, String tag) { String suffix = apiTemplateFiles().get(templateName); - return apiFileFolder() + File.separator + toApiFilename(tag) + suffix; + String filename = templateName.contains("_raw") ? toApiFilenameRaw(tag) : toApiFilename(tag); + return apiFileFolder() + File.separator + filename + suffix; } private void generateFiles(List> processTemplateToFileInfos, boolean shouldGenerate, String skippedByOption) { @@ -609,6 +634,7 @@ protected void generateEndpoints(OperationsMap objs) { endpointMap.put("imports", co.imports); endpointMap.put("schemaImports", co.schemaImports); endpointMap.put("typeImports", co.typeImports); + endpointMap.put("additionalModelImports", co.additionalModelImports); endpointMap.put("packageName", packageName); endpointMap.put("operations", operations); ((HashMap) operations.get("additionalProperties")).entrySet().forEach((entry) -> { @@ -951,6 +977,14 @@ public String toTypeImport(String name) { return "from " + packagePath() + "." + typePackage() + "." + toModelFilename(name) + " import " + toModelName(name); } + public String toPydanticImport(String name) { + return toPydanticImportBase(name) + " as " + toModelName(name) + "Pydantic"; + } + + public String toPydanticImportBase(String name) { + return "from " + packagePath() + "." + "pydantic" + "." + toModelFilename(name) + " import " + toModelName(name); + } + @Override @SuppressWarnings("static-method") public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { @@ -975,6 +1009,9 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List postProcessAllModels(Map objs) for (String importModelName : importModelNames) { cm.typeImports.add(toTypeImport(importModelName)); } + for (String importModelName : importModelNames) { + cm.additionalModelImports.add(toPydanticImport(importModelName)); + cm.additionalModelImportsModified.add(toPydanticImportBase(importModelName)); + } } } boolean testFolderSet = testFolder != null; @@ -1121,6 +1162,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo // templates use its presence to handle these badly named variables / keys if ((isReservedWord(cp.baseName) || !isValidPythonVarOrClassName(cp.baseName)) && !cp.baseName.equals(cp.name)) { cp.nameInSnakeCase = cp.name; + cp.hasProblematicName = true; } else { cp.nameInSnakeCase = null; } @@ -2828,6 +2870,11 @@ public String typeFileFolder() { return outputFolder + File.separatorChar + packagePath() + File.separatorChar + typePackage(); } + @Override + public String additionalModelFileFolder() { + return outputFolder + File.separatorChar + packagePath() + File.separatorChar + additionalModelPackage(); + } + @Override public String apiTestFileFolder() { return outputFolder + File.separatorChar + testFolder; diff --git a/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/model/PythonDependency.java b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/model/PythonDependency.java new file mode 100644 index 000000000..f9f59ed86 --- /dev/null +++ b/generator/konfig-generator-api/src/main/java/org/openapitools/codegen/model/PythonDependency.java @@ -0,0 +1,25 @@ +package org.openapitools.codegen.model; + +public class PythonDependency { + String name; + String version; + String setupPyModifier; + String poetryModifier; + + public PythonDependency(String name, String version, String setupPyModifier, String poetryModifier) { + this.name = name; + this.version = version; + this.setupPyModifier = setupPyModifier; + this.poetryModifier = poetryModifier; + } + + // example: certifi = ">=2023.7.22" + public String poetry() { + return name + " = " + "\"" + poetryModifier + version + "\""; + } + + // example: certifi = ">=2023.7.22" + public String setupPy() { + return "\"" + name + " " + setupPyModifier + " " + version + "\""; + } +} \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/__init__.py b/generator/konfig-generator-api/src/main/resources/python/__init__pydantic.handlebars similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/__init__.py rename to generator/konfig-generator-api/src/main/resources/python/__init__pydantic.handlebars diff --git a/generator/konfig-generator-api/src/main/resources/python/api.handlebars b/generator/konfig-generator-api/src/main/resources/python/api.handlebars index c91160d63..9a4beed91 100644 --- a/generator/konfig-generator-api/src/main/resources/python/api.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/api.handlebars @@ -7,6 +7,9 @@ from {{packageName}}.paths.{{nickname}}.{{httpMethod}} import {{operationIdCamelCase}} {{/each}} {{/with}} +{{#if prstv2}} +from {{packageName}}.apis.tags.{{classFilename}}_raw import {{classname}}Raw +{{/if}} {{#with operations}} @@ -18,5 +21,13 @@ class {{classname}}( """NOTE: {{> partial_class_header}} """ + {{#if prstv2}} + raw: {{classname}}Raw + + def __init__(self, api_client=None): + super().__init__(api_client) + self.raw = {{classname}}Raw(api_client) + {{else}} pass + {{/if}} {{/with}} diff --git a/generator/konfig-generator-api/src/main/resources/python/api_raw.handlebars b/generator/konfig-generator-api/src/main/resources/python/api_raw.handlebars new file mode 100644 index 000000000..ba20aa45d --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/api_raw.handlebars @@ -0,0 +1,22 @@ +# coding: utf-8 + +{{>partial_header}} + +{{#with operations}} +{{#each operation}} +from {{packageName}}.paths.{{nickname}}.{{httpMethod}} import {{operationIdCamelCase}}Raw +{{/each}} +{{/with}} + + +{{#with operations}} +class {{classname}}Raw( +{{#each operation}} + {{operationIdCamelCase}}Raw, +{{/each}} +): + """NOTE: +{{> partial_class_header}} + """ + pass +{{/with}} diff --git a/generator/konfig-generator-api/src/main/resources/python/endpoint.handlebars b/generator/konfig-generator-api/src/main/resources/python/endpoint.handlebars index 313c7d3ac..787eae789 100644 --- a/generator/konfig-generator-api/src/main/resources/python/endpoint.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/endpoint.handlebars @@ -23,6 +23,12 @@ from {{packageName}} import api_client, exceptions {{.}} {{/each}} +{{#if prstv2}} +{{#each additionalModelImports}} +{{.}} +{{/each}} + +{{/if}} {{#unless isStub}} from . import path @@ -215,10 +221,17 @@ class BaseApi(api_client.Api): {{> endpoint_operation_impl}} -class {{operationIdCamelCase}}(BaseApi): +class {{operationIdCamelCase}}{{#prstv2}}Raw{{/prstv2}}(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names {{> endpoint_interface_impl methodName=operationId}} +{{#prstv2}} + + +class {{operationIdCamelCase}}(BaseApi): + + {{> endpoint_pydantic_impl}} +{{/prstv2}} class ApiFor{{httpMethod}}(BaseApi): diff --git a/generator/konfig-generator-api/src/main/resources/python/endpoint_args.handlebars b/generator/konfig-generator-api/src/main/resources/python/endpoint_args.handlebars index 1e51b9508..14358bea8 100644 --- a/generator/konfig-generator-api/src/main/resources/python/endpoint_args.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/endpoint_args.handlebars @@ -77,6 +77,11 @@ {{/if}} stream: bool = False, {{/if}} +{{#if interface}} +{{#if validateArg}} + validate: bool = False, +{{/if}} +{{/if}} ){{#unless omitReturnType}} -> {{#if isMappedArgs}}api_client.MappedArgs{{else}}typing.Union[ {{#each responses}} {{#if isDefault}} diff --git a/generator/konfig-generator-api/src/main/resources/python/endpoint_pydantic_impl.handlebars b/generator/konfig-generator-api/src/main/resources/python/endpoint_pydantic_impl.handlebars new file mode 100644 index 000000000..71941c8bd --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/endpoint_pydantic_impl.handlebars @@ -0,0 +1,19 @@ +{{#if isDeprecated}}@api_client.DeprecationWarningOnce(prefix="{{clientApiName}}") +{{/if}}async def a{{operationId}}( +{{> endpoint_args async=true isOverload=false skipDeserialization="null" contentType="null" interface=true omitReturnType=true validateArg=true}} + raw_response = await self.raw.a{{operationId}}( + {{> endpoint_args_call_mapped_args}} + ) + if validate: + return {{returnType}}Pydantic(**raw_response.body) + return {{returnType}}Pydantic.model_construct(**raw_response.body) + +{{#if isDeprecated}}@api_client.DeprecationWarningOnce(prefix="{{clientApiName}}") +{{/if}}def {{operationId}}( +{{> endpoint_args isOverload=false skipDeserialization="null" contentType="null" interface=true omitReturnType=true validateArg=true}} + raw_response = self.raw.{{operationId}}( + {{> endpoint_args_call_mapped_args}} + ) + if validate: + return {{returnType}}Pydantic(**raw_response.body) + return {{returnType}}Pydantic.model_construct(**raw_response.body) diff --git a/generator/konfig-generator-api/src/main/resources/python/poetry.lock.handlebars b/generator/konfig-generator-api/src/main/resources/python/poetry.lock.handlebars index 87f54cb68..ae63e636c 100644 --- a/generator/konfig-generator-api/src/main/resources/python/poetry.lock.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/poetry.lock.handlebars @@ -124,6 +124,20 @@ files = [ [package.dependencies] frozenlist = ">=1.1.0" +[[package]] +name = "annotated-types" +version = "0.5.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.7" +files = [ + {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, + {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + [[package]] name = "async-timeout" version = "4.0.3" @@ -1086,6 +1100,143 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydantic" +version = "2.4.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"}, + {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.10.1" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.10.1" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"}, + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"}, + {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"}, + {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"}, + {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"}, + {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"}, + {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"}, + {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"}, + {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"}, + {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"}, + {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"}, + {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"}, + {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"}, + {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"}, + {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"}, + {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"}, + {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pygments" version = "2.16.1" @@ -1569,4 +1720,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "02c2989fbb1b73003fa0e92d935e28d376a0cdccd9203516e44cec910c485b40" +content-hash = "6c3c8e668e5534e5423d53ec7e0010528fad1bc013d10f7660f9b15a1e99dbfe" diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic.handlebars new file mode 100644 index 000000000..903bab294 --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic.handlebars @@ -0,0 +1,19 @@ +# coding: utf-8 + +{{>partial_header}} + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal +from pydantic import BaseModel, Field +{{#each models}} +{{#with model}} + +{{#each additionalModelImportsModified}} +{{.}} +{{/each}} + +{{> pydantic_templates/type}} +{{/with}} +{{/each}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type.handlebars new file mode 100644 index 000000000..a5ebbdab9 --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type.handlebars @@ -0,0 +1,6 @@ +{{> pydantic_templates/type_object}} +{{> pydantic_templates/type_composed}} +{{> pydantic_templates/type_enum}} +{{> pydantic_templates/type_list}} +{{> pydantic_templates/type_map}} +{{> pydantic_templates/type_primitive}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_composed.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_composed.handlebars new file mode 100644 index 000000000..0f23f70f9 --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_composed.handlebars @@ -0,0 +1,13 @@ +{{#if composedSchemas}} + {{#with composedSchemas}} + {{#if allOf}} +{{classname}} = typing.Union[{{#each allOf}}{{dataType}}{{#unless @last}},{{/unless}}{{/each}}] + {{/if}} + {{#if anyOf}} +{{classname}} = typing.Union[{{#each anyOf}}{{dataType}}{{#unless @last}},{{/unless}}{{/each}}] + {{/if}} + {{#if oneOf}} +{{classname}} = typing.Union[{{#each oneOf}}{{dataType}}{{#unless @last}},{{/unless}}{{/each}}] + {{/if}} + {{/with}} +{{/if}} diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_enum.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_enum.handlebars new file mode 100644 index 000000000..2263478b1 --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_enum.handlebars @@ -0,0 +1,3 @@ +{{#if isEnum}} +{{classname}} = Literal[{{#with allowableValues}}{{#each enumVars}}{{{value}}}{{#unless @last}}, {{/unless}}{{/each}}{{/with}}] +{{/if}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_list.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_list.handlebars new file mode 100644 index 000000000..e1ca83d9a --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_list.handlebars @@ -0,0 +1,3 @@ +{{#if isArray}} +{{classname}} = {{dataType}} +{{/if}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_map.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_map.handlebars new file mode 100644 index 000000000..a9b31c6af --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_map.handlebars @@ -0,0 +1,5 @@ +{{#if isMap}} +{{#unless hasVars}} +{{classname}} = {{dataType}} +{{/unless}} +{{/if}} diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_object.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_object.handlebars new file mode 100644 index 000000000..f9152f0f3 --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_object.handlebars @@ -0,0 +1,26 @@ +{{#if hasVars}} +class {{classname}}(BaseModel): + {{#each requiredVars}} + {{#if description}} + # {{{description}}} + {{/if}} + {{> pydantic_templates/type_property_name}}: {{{dataType}}} = Field(alias='{{baseName}}') + {{#unless @last}} + + {{/unless}} + {{/each}} + {{#each optionalVars}} + {{#if description}} + # {{{description}}} + {{/if}} + {{> pydantic_templates/type_property_name}}: {{{dataType}}} = Field(None, alias='{{baseName}}') + {{#unless @last}} + + {{/unless}} + {{/each}} + {{#unless requiredVars}} + {{#unless optionalVars}} + pass + {{/unless}} + {{/unless}} +{{/if}} diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_primitive.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_primitive.handlebars new file mode 100644 index 000000000..b3720863d --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_primitive.handlebars @@ -0,0 +1,5 @@ +{{#if isPrimitiveType}} +{{#unless isEnum}} +{{classname}} = {{dataType}} +{{/unless}} +{{/if}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_property_name.handlebars b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_property_name.handlebars new file mode 100644 index 000000000..9ccbe2aae --- /dev/null +++ b/generator/konfig-generator-api/src/main/resources/python/pydantic_templates/type_property_name.handlebars @@ -0,0 +1 @@ +{{nameInSnakeCaseLower}}{{#if hasProblematicName}}_{{/if}} \ No newline at end of file diff --git a/generator/konfig-generator-api/src/main/resources/python/pyproject.handlebars b/generator/konfig-generator-api/src/main/resources/python/pyproject.handlebars index a9c44800b..13eeea330 100644 --- a/generator/konfig-generator-api/src/main/resources/python/pyproject.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/pyproject.handlebars @@ -8,13 +8,7 @@ readme = "README.md" packages = [{include = "{{packageName}}"}] [tool.poetry.dependencies] -python = "^3.7" -certifi = ">=2023.7.22" -python-dateutil = "^2.8.2" -typing_extensions = "^4.3.0" -urllib3 = "^1.26.18" -frozendict = "^2.3.4" -aiohttp = "^3.8.4" +{{{poetryDependencies}}} [tool.poetry.group.dev.dependencies] setuptools = "^65.5.1" diff --git a/generator/konfig-generator-api/src/main/resources/python/setup.handlebars b/generator/konfig-generator-api/src/main/resources/python/setup.handlebars index 17add8b93..d8c7ffd2b 100644 --- a/generator/konfig-generator-api/src/main/resources/python/setup.handlebars +++ b/generator/konfig-generator-api/src/main/resources/python/setup.handlebars @@ -20,7 +20,7 @@ this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() REQUIRES = [ - {{> required_libraries quoted=true }} + {{{setupRequirements}}} ] setup( @@ -31,13 +31,12 @@ setup( author_email="{{#if infoEmail}}{{infoEmail}}{{else}}engineering@konfigthis.com{{/if}}", url="{{#if packageUrl}}{{packageUrl}}{{/if}}{{#unless packageUrl}}https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{/unless}}", keywords=[{{#unless removeKonfigBranding}}"Konfig", {{/unless}}"{{{appName}}}"], - license="MIT", python_requires="{{{generatorLanguageVersion}}}", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, - {{#if licenseInfo}}license="{{licenseInfo}}", - {{/if}}long_description=long_description, + license="{{#if licenseInfo}}{{licenseInfo}}{{else}}MIT{{/if}}", + long_description=long_description, long_description_content_type='text/markdown' ) {{/with}} diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/__init__.py b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/leap_workflows/pydantic/__init__.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/__init__.py rename to generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/leap_workflows/pydantic/__init__.py diff --git a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/poetry.lock b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/poetry.lock index 87f54cb68..ae63e636c 100644 --- a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/poetry.lock +++ b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/poetry.lock @@ -124,6 +124,20 @@ files = [ [package.dependencies] frozenlist = ">=1.1.0" +[[package]] +name = "annotated-types" +version = "0.5.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.7" +files = [ + {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, + {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + [[package]] name = "async-timeout" version = "4.0.3" @@ -1086,6 +1100,143 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydantic" +version = "2.4.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"}, + {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.10.1" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.10.1" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"}, + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"}, + {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"}, + {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"}, + {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"}, + {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"}, + {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"}, + {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"}, + {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"}, + {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"}, + {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"}, + {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"}, + {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"}, + {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"}, + {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"}, + {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"}, + {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pygments" version = "2.16.1" @@ -1569,4 +1720,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "02c2989fbb1b73003fa0e92d935e28d376a0cdccd9203516e44cec910c485b40" +content-hash = "6c3c8e668e5534e5423d53ec7e0010528fad1bc013d10f7660f9b15a1e99dbfe" diff --git a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/pyproject.toml b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/pyproject.toml index 831900686..f2678f05b 100644 --- a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/pyproject.toml +++ b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/pyproject.toml @@ -15,6 +15,7 @@ typing_extensions = "^4.3.0" urllib3 = "^1.26.18" frozendict = "^2.3.4" aiohttp = "^3.8.4" +pydantic = "^2.4.2" [tool.poetry.group.dev.dependencies] setuptools = "^65.5.1" diff --git a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/setup.py b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/setup.py index bb4c633c1..de9022bdf 100644 --- a/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/setup.py +++ b/generator/konfig-integration-tests/sdks/leap-workflows-sdks/sdks/python/setup.py @@ -27,12 +27,14 @@ long_description = (this_directory / "README.md").read_text() REQUIRES = [ - "certifi >= 2022.12.7", - "frozendict ~= 2.3.4", + "certifi >= 2023.7.22", "python-dateutil ~= 2.8.2", "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", - "validators ~= 0.20.0",] + "urllib3 ~= 1.26.18", + "frozendict ~= 2.3.4", + "aiohttp ~= 3.8.4", + "pydantic ~= 2.4.2" +] setup( name=NAME, @@ -42,11 +44,11 @@ author_email="help@tryleap.ai", url="https://github.com/leap-ai/workflows-sdks/tree/main/sdks/python", keywords=["Konfig", "Leap Workflows API"], - license="MIT", python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, + license="MIT", long_description=long_description, long_description_content_type='text/markdown' ) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/README.md b/generator/konfig-integration-tests/sdks/python-dataclass-responses/README.md deleted file mode 100644 index d6ea0ab00..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# konfig - -|Language|Version|Package Manager|Documentation|Source| -|-|-|-|-|-| -|Python|1.0.0|[PyPI](https://pypi.org/project/python-dataclass-responses-python-sdk/1.0.0)|[Documentation](https://github.com/konfig-dev/konfig/tree/main/python/blob/main/README.md)|[Source](https://github.com/konfig-dev/konfig/tree/main/python)| \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.konfigignore b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.konfigignore deleted file mode 100644 index 0545d9a83..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.konfigignore +++ /dev/null @@ -1 +0,0 @@ -test/test_dataclass_response.py \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/__init__.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/__init__.py deleted file mode 100644 index 8401992c8..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - Python Dataclass Responses API - - A simple API based on python dataclass responses. - - The version of the OpenAPI document: 1.0.0 - Contact: support@example.com - Created by: http://example.com/support -""" - -__version__ = "1.0.0" - -# import ApiClient -from python_dataclass_responses.api_client import ApiClient - -# import Configuration -from python_dataclass_responses.configuration import Configuration - -# import exceptions -from python_dataclass_responses.exceptions import OpenApiException -from python_dataclass_responses.exceptions import ApiAttributeError -from python_dataclass_responses.exceptions import ApiTypeError -from python_dataclass_responses.exceptions import ApiValueError -from python_dataclass_responses.exceptions import ApiKeyError -from python_dataclass_responses.exceptions import ApiException - -from python_dataclass_responses.client import PythonDataclassResponses diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/path_to_api.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/path_to_api.py deleted file mode 100644 index 3d0555156..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/path_to_api.py +++ /dev/null @@ -1,17 +0,0 @@ -import typing_extensions - -from python_dataclass_responses.paths import PathValues -from python_dataclass_responses.apis.paths.simple_endpoint import SimpleEndpoint - -PathToApi = typing_extensions.TypedDict( - 'PathToApi', - { - PathValues.SIMPLEENDPOINT: SimpleEndpoint, - } -) - -path_to_api = PathToApi( - { - PathValues.SIMPLEENDPOINT: SimpleEndpoint, - } -) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/simple_endpoint.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/simple_endpoint.py deleted file mode 100644 index e5c4e2c14..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/simple_endpoint.py +++ /dev/null @@ -1,7 +0,0 @@ -from python_dataclass_responses.paths.simple_endpoint.get import ApiForget - - -class SimpleEndpoint( - ApiForget, -): - pass diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/test_api.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/test_api.py deleted file mode 100644 index 1e6c92688..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/test_api.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding: utf-8 - -""" - Python Dataclass Responses API - - A simple API based on python dataclass responses. - - The version of the OpenAPI document: 1.0.0 - Contact: support@example.com - Created by: http://example.com/support -""" - -from python_dataclass_responses.paths.simple_endpoint.get import Fetch - - -class TestApi( - Fetch, -): - """NOTE: - This class is auto generated by Konfig (https://konfigthis.com) - """ - pass diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/models/__init__.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/models/__init__.py deleted file mode 100644 index fd417d725..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/models/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from python_dataclass_responses.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) - -from python_dataclass_responses.model.test_fetch400_response import TestFetch400Response -from python_dataclass_responses.model.test_fetch500_response import TestFetch500Response -from python_dataclass_responses.model.test_fetch_response import TestFetchResponse diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_dataclass_response.py b/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_dataclass_response.py deleted file mode 100644 index 41b396cd1..000000000 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_dataclass_response.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding: utf-8 - - -import unittest - -import os -from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses -from dataclasses import is_dataclass - - -class TestSimple(unittest.TestCase): - def setUp(self): - pass - - def test_response_is_dataclass(self): - pythondataclassresponses = PythonDataclassResponses( - api_key="YOUR_API_KEY", host="http://127.0.0.1:4011" - ) - response = pythondataclassresponses.test.fetch("input") - self.assertTrue(is_dataclass(response)) - - def tearDown(self): - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/progress.yaml b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/progress.yaml similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/progress.yaml rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/progress.yaml diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/ruleset-version b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/ruleset-version similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/ruleset-version rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/ruleset-version diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/ruleset.js b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/ruleset.js similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.konfig/ruleset.js rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.konfig/ruleset.js diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.spectral.yaml b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.spectral.yaml similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.spectral.yaml rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.spectral.yaml diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.vscode/extensions.json b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.vscode/extensions.json similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.vscode/extensions.json rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.vscode/extensions.json diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/.vscode/settings.json b/generator/konfig-integration-tests/sdks/python-pydantic-responses/.vscode/settings.json similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/.vscode/settings.json rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/.vscode/settings.json diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/LICENSE b/generator/konfig-integration-tests/sdks/python-pydantic-responses/LICENSE similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/LICENSE rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/LICENSE diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/README.md b/generator/konfig-integration-tests/sdks/python-pydantic-responses/README.md new file mode 100644 index 000000000..66d022c8d --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/README.md @@ -0,0 +1,5 @@ +# konfig + +|Language|Version|Package Manager|Documentation|Source| +|-|-|-|-|-| +|Python|1.0.0|[PyPI](https://pypi.org/project/python-pydantic-responses-python-sdk/1.0.0)|[Documentation](https://github.com/konfig-dev/konfig/tree/main/python/blob/main/README.md)|[Source](https://github.com/konfig-dev/konfig/tree/main/python)| \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/api.yaml b/generator/konfig-integration-tests/sdks/python-pydantic-responses/api.yaml similarity index 76% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/api.yaml rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/api.yaml index a64ac8844..6209cabb4 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/api.yaml +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/api.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: - title: Python Dataclass Responses API - description: A simple API based on python dataclass responses. + title: Python Pydantic Responses API + description: A simple API based on python pydantic responses. version: 1.0.0 termsOfService: http://example.com/terms/ contact: @@ -13,10 +13,23 @@ info: url: http://www.apache.org/licenses/LICENSE-2.0.html servers: - description: Live API server - url: https://python-dataclass-responses.konfigthis.com + url: https://python-pydantic-responses.konfigthis.com tags: - name: Test paths: + /reserved-word: + get: + tags: + - Test + operationId: Test_reservedWord + description: Reserved word in Python + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/TestReservedWord' /simple-endpoint: get: tags: @@ -57,6 +70,12 @@ components: in: header name: X-API-KEY schemas: + TestReservedWord: + type: object + properties: + class: + description: Reserved word in Python + type: string TestFetchResponse: type: object properties: diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/konfig.yaml b/generator/konfig-integration-tests/sdks/python-pydantic-responses/konfig.yaml similarity index 56% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/konfig.yaml rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/konfig.yaml index 17cac81e0..644bd580a 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/konfig.yaml +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/konfig.yaml @@ -1,14 +1,14 @@ # yaml-language-server: $schema=https://unpkg.com/konfig-lib@latest/konfig-yaml.schema.json -outputDirectory: /tmp/python-dataclass-responses-sdks-out +outputDirectory: /tmp/python-pydantic-responses-sdks-out specPath: api.yaml generators: python: version: 1.0.0 - packageName: python_dataclass_responses - projectName: python-dataclass-responses-python-sdk + packageName: python_pydantic + projectName: python-pydantic-responses-python-sdk outputDirectory: python - clientName: PythonDataclassResponses + clientName: PythonPydanticResponses git: userId: konfig-dev repoId: konfig/tree/main/python diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.gitignore b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.gitignore similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.gitignore rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.gitignore diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.konfigignore b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.konfigignore new file mode 100644 index 000000000..7dfe19f7a --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.konfigignore @@ -0,0 +1 @@ +test/test_pydantic_response.py \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.vscode/settings.json b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.vscode/settings.json similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/.vscode/settings.json rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/.vscode/settings.json diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/LICENSE b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/LICENSE similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/LICENSE rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/LICENSE diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/README.md b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/README.md similarity index 70% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/README.md rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/README.md index ce343ae07..b5448d858 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/README.md +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/README.md @@ -1,9 +1,9 @@ -# python-dataclass-responses-python-sdk +# python-pydantic-responses-python-sdk -A simple API based on python dataclass responses. +A simple API based on python pydantic responses. -[![PyPI](https://img.shields.io/badge/PyPI-v1.0.0-blue)](https://pypi.org/project/python-dataclass-responses-python-sdk/1.0.0) +[![PyPI](https://img.shields.io/badge/PyPI-v1.0.0-blue)](https://pypi.org/project/python-pydantic-responses-python-sdk/1.0.0) [![GitHub last commit](https://img.shields.io/github/last-commit/konfig-dev/konfig.svg)](https://github.com/konfig-dev/konfig/commits) [![README.md](https://img.shields.io/badge/README-Click%20Here-green)](https://github.com/konfig-dev/konfig/tree/main/python#readme) [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](http://example.com/support) @@ -17,7 +17,8 @@ A simple API based on python dataclass responses. - [Getting Started](#getting-started) - [Async](#async) - [Reference](#reference) - * [`pythondataclassresponses.test.fetch`](#pythondataclassresponsestestfetch) + * [`pythonpydanticresponses.test.fetch`](#pythonpydanticresponsestestfetch) + * [`pythonpydanticresponses.test.reserved_word`](#pythonpydanticresponsestestreserved_word) @@ -28,22 +29,22 @@ Python >=3.7 ## Installing ```sh -pip install python-dataclass-responses-python-sdk==1.0.0 +pip install python-pydantic-responses-python-sdk==1.0.0 ``` ## Getting Started ```python from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses, ApiException +from python_pydantic import PythonPydanticResponses, ApiException -pythondataclassresponses = PythonDataclassResponses( +pythonpydanticresponses = PythonPydanticResponses( api_key="YOUR_API_KEY", ) try: # Fetches a JSON value based on input parameter - fetch_response = pythondataclassresponses.test.fetch( + fetch_response = pythonpydanticresponses.test.fetch( input_parameter="inputParameter_example", ) pprint(fetch_response.body) @@ -73,9 +74,9 @@ except ApiException as e: ```python import asyncio from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses, ApiException +from python_pydantic import PythonPydanticResponses, ApiException -pythondataclassresponses = PythonDataclassResponses( +pythonpydanticresponses = PythonPydanticResponses( api_key="YOUR_API_KEY", ) @@ -83,7 +84,7 @@ pythondataclassresponses = PythonDataclassResponses( async def main(): try: # Fetches a JSON value based on input parameter - fetch_response = await pythondataclassresponses.test.afetch( + fetch_response = await pythonpydanticresponses.test.afetch( input_parameter="inputParameter_example", ) pprint(fetch_response.body) @@ -111,14 +112,14 @@ asyncio.run(main()) ## Reference -### `pythondataclassresponses.test.fetch` +### `pythonpydanticresponses.test.fetch` Provide an input parameter to receive a JSON value with properties. #### 🛠️ Usage ```python -fetch_response = pythondataclassresponses.test.fetch( +fetch_response = pythonpydanticresponses.test.fetch( input_parameter="inputParameter_example", ) ``` @@ -131,7 +132,7 @@ The input parameter to process. #### 🔄 Return -[TestFetchResponse](./python_dataclass_responses/type/test_fetch_response.py) +[TestFetchResponse](./python_pydantic/type/test_fetch_response.py) #### 🌐 Endpoint @@ -141,6 +142,28 @@ The input parameter to process. --- +### `pythonpydanticresponses.test.reserved_word` + +Reserved word in Python + +#### 🛠️ Usage + +```python +reserved_word_response = pythonpydanticresponses.test.reserved_word() +``` + +#### 🔄 Return + +[TestReservedWord](./python_pydantic/type/test_reserved_word.py) + +#### 🌐 Endpoint + +`/reserved-word` `get` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + ## Author This Python package is automatically generated by [Konfig](https://konfigthis.com) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/poetry.lock b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/poetry.lock similarity index 87% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/poetry.lock rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/poetry.lock index 87f54cb68..ae63e636c 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/poetry.lock +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/poetry.lock @@ -124,6 +124,20 @@ files = [ [package.dependencies] frozenlist = ">=1.1.0" +[[package]] +name = "annotated-types" +version = "0.5.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.7" +files = [ + {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, + {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + [[package]] name = "async-timeout" version = "4.0.3" @@ -1086,6 +1100,143 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydantic" +version = "2.4.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"}, + {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.10.1" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.10.1" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"}, + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"}, + {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"}, + {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"}, + {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"}, + {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"}, + {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"}, + {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"}, + {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"}, + {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"}, + {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"}, + {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"}, + {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"}, + {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"}, + {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"}, + {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"}, + {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pygments" version = "2.16.1" @@ -1569,4 +1720,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "02c2989fbb1b73003fa0e92d935e28d376a0cdccd9203516e44cec910c485b40" +content-hash = "6c3c8e668e5534e5423d53ec7e0010528fad1bc013d10f7660f9b15a1e99dbfe" diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/pyproject.toml b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/pyproject.toml similarity index 78% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/pyproject.toml rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/pyproject.toml index d77a0e454..966feecd0 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/pyproject.toml +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/pyproject.toml @@ -1,11 +1,11 @@ [tool.poetry] -name = "python-dataclass-responses-python-sdk" +name = "python-pydantic-responses-python-sdk" version = "1.0.0" -description = "Client for Python Dataclass Responses API" +description = "Client for Python Pydantic Responses API" authors = ["API Support "] license = "MIT" readme = "README.md" -packages = [{include = "python_dataclass_responses"}] +packages = [{include = "python_pydantic"}] [tool.poetry.dependencies] python = "^3.7" @@ -15,6 +15,7 @@ typing_extensions = "^4.3.0" urllib3 = "^1.26.18" frozendict = "^2.3.4" aiohttp = "^3.8.4" +pydantic = "^2.4.2" [tool.poetry.group.dev.dependencies] setuptools = "^65.5.1" diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/__init__.py new file mode 100644 index 000000000..70c63c87b --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/__init__.py @@ -0,0 +1,31 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +__version__ = "1.0.0" + +# import ApiClient +from python_pydantic.api_client import ApiClient + +# import Configuration +from python_pydantic.configuration import Configuration + +# import exceptions +from python_pydantic.exceptions import OpenApiException +from python_pydantic.exceptions import ApiAttributeError +from python_pydantic.exceptions import ApiTypeError +from python_pydantic.exceptions import ApiValueError +from python_pydantic.exceptions import ApiKeyError +from python_pydantic.exceptions import ApiException + +from python_pydantic.client import PythonPydanticResponses diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/api_client.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/api_client.py similarity index 99% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/api_client.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/api_client.py index 06e03c7fc..1648806bd 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/api_client.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/api_client.py @@ -1,8 +1,8 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -32,14 +32,14 @@ import frozendict -from python_dataclass_responses import rest -from python_dataclass_responses.api_response import ApiResponse, AsyncApiResponse -from python_dataclass_responses.rest import AsyncResponseWrapper, ResponseWrapper -from python_dataclass_responses.configuration import Configuration -from python_dataclass_responses.exceptions import ApiTypeError, ApiValueError, MissingRequiredParametersError -from python_dataclass_responses.request_after_hook import request_after_hook -from python_dataclass_responses.request_before_url_hook import request_before_url_hook -from python_dataclass_responses.schemas import ( +from python_pydantic import rest +from python_pydantic.api_response import ApiResponse, AsyncApiResponse +from python_pydantic.rest import AsyncResponseWrapper, ResponseWrapper +from python_pydantic.configuration import Configuration +from python_pydantic.exceptions import ApiTypeError, ApiValueError, MissingRequiredParametersError +from python_pydantic.request_after_hook import request_after_hook +from python_pydantic.request_before_url_hook import request_before_url_hook +from python_pydantic.schemas import ( NoneClass, BoolClass, Schema, diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/api_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/api_response.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/api_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/api_response.py diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/__init__.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/__init__.py diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/path_to_api.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/path_to_api.py new file mode 100644 index 000000000..ec0805eb2 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/path_to_api.py @@ -0,0 +1,20 @@ +import typing_extensions + +from python_pydantic.paths import PathValues +from python_pydantic.apis.paths.reserved_word import ReservedWord +from python_pydantic.apis.paths.simple_endpoint import SimpleEndpoint + +PathToApi = typing_extensions.TypedDict( + 'PathToApi', + { + PathValues.RESERVEDWORD: ReservedWord, + PathValues.SIMPLEENDPOINT: SimpleEndpoint, + } +) + +path_to_api = PathToApi( + { + PathValues.RESERVEDWORD: ReservedWord, + PathValues.SIMPLEENDPOINT: SimpleEndpoint, + } +) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/__init__.py similarity index 72% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/__init__.py index f090069d9..3a3709c76 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/paths/__init__.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/__init__.py @@ -1,3 +1,3 @@ # do not import all endpoints into this module because that uses a lot of memory and stack frames # if you need the ability to import all endpoints from this module, import them with -# from python_dataclass_responses.apis.path_to_api import path_to_api +# from python_pydantic.apis.path_to_api import path_to_api diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/reserved_word.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/reserved_word.py new file mode 100644 index 000000000..1ac5459fa --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/reserved_word.py @@ -0,0 +1,7 @@ +from python_pydantic.paths.reserved_word.get import ApiForget + + +class ReservedWord( + ApiForget, +): + pass diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/simple_endpoint.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/simple_endpoint.py new file mode 100644 index 000000000..54f512053 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/paths/simple_endpoint.py @@ -0,0 +1,7 @@ +from python_pydantic.paths.simple_endpoint.get import ApiForget + + +class SimpleEndpoint( + ApiForget, +): + pass diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tag_to_api.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tag_to_api.py similarity index 61% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tag_to_api.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tag_to_api.py index 66ca563df..cd6f5559c 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tag_to_api.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tag_to_api.py @@ -1,7 +1,7 @@ import typing_extensions -from python_dataclass_responses.apis.tags import TagValues -from python_dataclass_responses.apis.tags.test_api import TestApi +from python_pydantic.apis.tags import TagValues +from python_pydantic.apis.tags.test_api import TestApi TagToApi = typing_extensions.TypedDict( 'TagToApi', diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/__init__.py similarity index 78% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/__init__.py index b87cced75..cec254273 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/apis/tags/__init__.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/__init__.py @@ -1,6 +1,6 @@ # do not import all endpoints into this module because that uses a lot of memory and stack frames # if you need the ability to import all endpoints from this module, import them with -# from python_dataclass_responses.apis.tag_to_api import tag_to_api +# from python_pydantic.apis.tag_to_api import tag_to_api import enum diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api.py new file mode 100644 index 000000000..cdda4a613 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from python_pydantic.paths.simple_endpoint.get import Fetch +from python_pydantic.paths.reserved_word.get import ReservedWord +from python_pydantic.apis.tags.test_api_raw import TestApiRaw + + +class TestApi( + Fetch, + ReservedWord, +): + """NOTE: + This class is auto generated by Konfig (https://konfigthis.com) + """ + raw: TestApiRaw + + def __init__(self, api_client=None): + super().__init__(api_client) + self.raw = TestApiRaw(api_client) diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api_raw.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api_raw.py new file mode 100644 index 000000000..5cc38091d --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/apis/tags/test_api_raw.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from python_pydantic.paths.simple_endpoint.get import FetchRaw +from python_pydantic.paths.reserved_word.get import ReservedWordRaw + + +class TestApiRaw( + FetchRaw, + ReservedWordRaw, +): + """NOTE: + This class is auto generated by Konfig (https://konfigthis.com) + """ + pass diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.py similarity index 57% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.py index 2baf8496f..33fac6e29 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.py @@ -1,8 +1,8 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,15 +12,15 @@ import typing import inspect from datetime import date, datetime -from python_dataclass_responses.client_custom import ClientCustom -from python_dataclass_responses.configuration import Configuration -from python_dataclass_responses.api_client import ApiClient -from python_dataclass_responses.type_util import copy_signature -from python_dataclass_responses.apis.tags.test_api import TestApi +from python_pydantic.client_custom import ClientCustom +from python_pydantic.configuration import Configuration +from python_pydantic.api_client import ApiClient +from python_pydantic.type_util import copy_signature +from python_pydantic.apis.tags.test_api import TestApi -class PythonDataclassResponses(ClientCustom): +class PythonPydanticResponses(ClientCustom): def __init__(self, configuration: typing.Union[Configuration, None] = None, **kwargs): super().__init__(configuration, **kwargs) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.pyi similarity index 57% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.pyi rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.pyi index 2baf8496f..33fac6e29 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client.pyi +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client.pyi @@ -1,8 +1,8 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,15 +12,15 @@ import typing import inspect from datetime import date, datetime -from python_dataclass_responses.client_custom import ClientCustom -from python_dataclass_responses.configuration import Configuration -from python_dataclass_responses.api_client import ApiClient -from python_dataclass_responses.type_util import copy_signature -from python_dataclass_responses.apis.tags.test_api import TestApi +from python_pydantic.client_custom import ClientCustom +from python_pydantic.configuration import Configuration +from python_pydantic.api_client import ApiClient +from python_pydantic.type_util import copy_signature +from python_pydantic.apis.tags.test_api import TestApi -class PythonDataclassResponses(ClientCustom): +class PythonPydanticResponses(ClientCustom): def __init__(self, configuration: typing.Union[Configuration, None] = None, **kwargs): super().__init__(configuration, **kwargs) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client_custom.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client_custom.py similarity index 72% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client_custom.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client_custom.py index 9e9fb41ba..08bd498ff 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/client_custom.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/client_custom.py @@ -1,8 +1,8 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -11,8 +11,8 @@ import typing -from python_dataclass_responses.configuration import Configuration -from python_dataclass_responses.api_client import ApiClient +from python_pydantic.configuration import Configuration +from python_pydantic.api_client import ApiClient diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/configuration.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py similarity index 96% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/configuration.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py index fd146654d..04e5f7001 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/configuration.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/configuration.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -20,9 +20,9 @@ import re from urllib.parse import urlparse from http import client as http_client -from python_dataclass_responses.exceptions_base import ApiValueError -from python_dataclass_responses.exceptions import ClientConfigurationError -from python_dataclass_responses.exceptions import InvalidHostConfigurationError +from python_pydantic.exceptions_base import ApiValueError +from python_pydantic.exceptions import ClientConfigurationError +from python_pydantic.exceptions import InvalidHostConfigurationError JSON_SCHEMA_VALIDATION_KEYWORDS = { @@ -93,7 +93,7 @@ class Configuration(object): You can programmatically set the cookie: -conf = python_dataclass_responses.Configuration( +conf = python_pydantic.Configuration( api_key={'cookieAuth': 'abc123'} api_key_prefix={'cookieAuth': 'JSESSIONID'} ) @@ -115,7 +115,7 @@ def __init__(self, host=None, ): """Constructor """ - self.host = "https://python-dataclass-responses.konfigthis.com" if host is None else host + self.host = "https://python-pydantic-responses.konfigthis.com" if host is None else host """Default Base url """ self.server_index = 0 if server_index is None and host is None else server_index @@ -162,7 +162,7 @@ def __init__(self, host=None, self.disabled_client_side_validations = disabled_client_side_validations """Logging Settings """ - self.logger = logging.getLogger("python_dataclass_responses") + self.logger = logging.getLogger("python_pydantic") # if no handler for logger, add a stream handler if not self.logger.handlers: self.logger.addHandler(logging.StreamHandler()) @@ -416,7 +416,7 @@ def get_host_settings(self): """ return [ { - 'url': "https://python-dataclass-responses.konfigthis.com", + 'url': "https://python-pydantic-responses.konfigthis.com", 'description': "Live API server", } ] diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/exceptions.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/exceptions.py similarity index 96% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/exceptions.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/exceptions.py index 6a54de21f..00289c138 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/exceptions.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/exceptions.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,8 +12,8 @@ import typing -from python_dataclass_responses.api_response import ApiResponse, AsyncApiResponse -from python_dataclass_responses.exceptions_base import OpenApiException, ApiTypeError, ApiValueError, render_path +from python_pydantic.api_response import ApiResponse, AsyncApiResponse +from python_pydantic.exceptions_base import OpenApiException, ApiTypeError, ApiValueError, render_path class ClientConfigurationError(OpenApiException): def __init__(self, msg): diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/exceptions_base.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/exceptions_base.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/exceptions_base.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/exceptions_base.py diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/__init__.py similarity index 82% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/__init__.py index 30ba88bbb..b71289aa8 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/__init__.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/__init__.py @@ -2,4 +2,4 @@ # reference which would not work in python2 # do not import all models into this module because that uses a lot of memory and stack frames # if you need the ability to import all models from one package, import them with -# from python_dataclass_responses.models import ModelA, ModelB +# from python_pydantic.models import ModelA, ModelB diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.py similarity index 93% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.py index 4a0854d30..483a51ca2 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetch400Response( diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.pyi similarity index 93% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.pyi rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.pyi index 4a0854d30..483a51ca2 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch400_response.pyi +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch400_response.pyi @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import uuid # noqa: F401 import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetch400Response( diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.py similarity index 93% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.py index c5abff689..f98fb7839 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetch500Response( diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.pyi similarity index 93% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.pyi rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.pyi index c5abff689..f98fb7839 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch500_response.pyi +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch500_response.pyi @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import uuid # noqa: F401 import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetch500Response( diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.py similarity index 95% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.py index 6bca5fb27..8fbcaa64d 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetchResponse( diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.pyi similarity index 95% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.pyi rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.pyi index 6bca5fb27..8fbcaa64d 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/model/test_fetch_response.pyi +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_fetch_response.pyi @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -21,7 +21,7 @@ import uuid # noqa: F401 import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 class TestFetchResponse( diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.py new file mode 100644 index 000000000..8ece01e15 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from python_pydantic import schemas # noqa: F401 + + +class TestReservedWord( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + _class = schemas.StrSchema + __annotations__ = { + "class": _class, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["class", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["class", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestReservedWord': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.pyi new file mode 100644 index 000000000..8ece01e15 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/model/test_reserved_word.pyi @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from python_pydantic import schemas # noqa: F401 + + +class TestReservedWord( + schemas.DictSchema +): + """ + This class is auto generated by Konfig (https://konfigthis.com) + """ + + + class MetaOapg: + + class properties: + _class = schemas.StrSchema + __annotations__ = { + "class": _class, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["class"]) -> MetaOapg.properties._class: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["class", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["class"]) -> typing.Union[MetaOapg.properties._class, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["class", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'TestReservedWord': + return super().__new__( + cls, + *args, + _configuration=_configuration, + **kwargs, + ) diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/models/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/models/__init__.py new file mode 100644 index 000000000..ecff55421 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/models/__init__.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from from python_pydantic.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from python_pydantic.model.test_fetch400_response import TestFetch400Response +from python_pydantic.model.test_fetch500_response import TestFetch500Response +from python_pydantic.model.test_fetch_response import TestFetchResponse +from python_pydantic.model.test_reserved_word import TestReservedWord diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/__init__.py similarity index 74% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/__init__.py index 405c3571d..6907cd28e 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/__init__.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/__init__.py @@ -1,9 +1,10 @@ # do not import all endpoints into this module because that uses a lot of memory and stack frames # if you need the ability to import all endpoints from this module, import them with -# from python_dataclass_responses.apis.path_to_api import path_to_api +# from python_pydantic.apis.path_to_api import path_to_api import enum class PathValues(str, enum.Enum): + RESERVEDWORD = "/reserved-word" SIMPLEENDPOINT = "/simple-endpoint" diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/__init__.py new file mode 100644 index 000000000..08592c527 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from python_pydantic.paths.reserved_word import Api + +from python_pydantic.paths import PathValues + +path = PathValues.RESERVEDWORD \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.py new file mode 100644 index 000000000..9754ff04f --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.py @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from python_pydantic.request_before_hook import request_before_hook +import json +from urllib3._collections import HTTPHeaderDict + +from python_pydantic.api_response import AsyncGeneratorResponse +from python_pydantic import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from python_pydantic import schemas # noqa: F401 + +from python_pydantic.model.test_reserved_word import TestReservedWord as TestReservedWordSchema + +from python_pydantic.type.test_reserved_word import TestReservedWord + +from python_pydantic.pydantic.test_reserved_word import TestReservedWord as TestReservedWordPydantic + +from . import path + +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = TestReservedWordSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + body: TestReservedWord + + +@dataclass +class ApiResponseFor200Async(api_client.AsyncApiResponse): + body: TestReservedWord + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + response_cls_async=ApiResponseFor200Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _reserved_word_mapped_args( + self, + ) -> api_client.MappedArgs: + args: api_client.MappedArgs = api_client.MappedArgs() + return args + + async def _areserved_word_oapg( + self, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + auth_settings=_auth, + headers=_headers, + ) + + response = await self.api_client.async_call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + if stream: + if not 200 <= response.http_response.status <= 299: + body = (await response.http_response.content.read()).decode("utf-8") + raise exceptions.ApiStreamingException( + status=response.http_response.status, + reason=response.http_response.reason, + body=body, + ) + + async def stream_iterator(): + """ + iterates over response.http_response.content and closes connection once iteration has finished + """ + async for line in response.http_response.content: + if line == b'\r\n': + continue + yield line + response.http_response.close() + await response.session.close() + return AsyncGeneratorResponse( + content=stream_iterator(), + headers=response.http_response.headers, + status=response.http_response.status, + response=response.http_response + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = await response_for_status.deserialize_async( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserializationAsync( + body=await response.http_response.json() if is_json else await response.http_response.text(), + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + # cleanup session / response + response.http_response.close() + await response.session.close() + + return api_response + + + def _reserved_word_oapg( + self, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + auth_settings=_auth, + headers=_headers, + ) + + response = self.api_client.call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = response_for_status.deserialize( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserialization( + body=json.loads(response.http_response.data) if is_json else response.http_response.data, + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class ReservedWordRaw(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + async def areserved_word( + self, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._reserved_word_mapped_args( + ) + return await self._areserved_word_oapg( + ) + + def reserved_word( + self, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + args = self._reserved_word_mapped_args( + ) + return self._reserved_word_oapg( + ) + +class ReservedWord(BaseApi): + + async def areserved_word( + self, + validate: bool = False, + ): + raw_response = await self.raw.areserved_word( + ) + if validate: + return TestReservedWordPydantic(**raw_response.body) + return TestReservedWordPydantic.model_construct(**raw_response.body) + + def reserved_word( + self, + validate: bool = False, + ): + raw_response = self.raw.reserved_word( + ) + if validate: + return TestReservedWordPydantic(**raw_response.body) + return TestReservedWordPydantic.model_construct(**raw_response.body) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + async def aget( + self, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._reserved_word_mapped_args( + ) + return await self._areserved_word_oapg( + ) + + def get( + self, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + args = self._reserved_word_mapped_args( + ) + return self._reserved_word_oapg( + ) + diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.pyi new file mode 100644 index 000000000..3551bdc2a --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/reserved_word/get.pyi @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from python_pydantic.request_before_hook import request_before_hook +import json +from urllib3._collections import HTTPHeaderDict + +from python_pydantic.api_response import AsyncGeneratorResponse +from python_pydantic import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from python_pydantic import schemas # noqa: F401 + +from python_pydantic.model.test_reserved_word import TestReservedWord as TestReservedWordSchema + +from python_pydantic.type.test_reserved_word import TestReservedWord + +from python_pydantic.pydantic.test_reserved_word import TestReservedWord as TestReservedWordPydantic + +SchemaFor200ResponseBodyApplicationJson = TestReservedWordSchema + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + body: TestReservedWord + + +@dataclass +class ApiResponseFor200Async(api_client.AsyncApiResponse): + body: TestReservedWord + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + response_cls_async=ApiResponseFor200Async, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + + def _reserved_word_mapped_args( + self, + ) -> api_client.MappedArgs: + args: api_client.MappedArgs = api_client.MappedArgs() + return args + + async def _areserved_word_oapg( + self, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + auth_settings=_auth, + headers=_headers, + ) + + response = await self.api_client.async_call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + if stream: + if not 200 <= response.http_response.status <= 299: + body = (await response.http_response.content.read()).decode("utf-8") + raise exceptions.ApiStreamingException( + status=response.http_response.status, + reason=response.http_response.reason, + body=body, + ) + + async def stream_iterator(): + """ + iterates over response.http_response.content and closes connection once iteration has finished + """ + async for line in response.http_response.content: + if line == b'\r\n': + continue + yield line + response.http_response.close() + await response.session.close() + return AsyncGeneratorResponse( + content=stream_iterator(), + headers=response.http_response.headers, + status=response.http_response.status, + response=response.http_response + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = await response_for_status.deserialize_async( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserializationAsync( + body=await response.http_response.json() if is_json else await response.http_response.text(), + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + # cleanup session / response + response.http_response.close() + await response.session.close() + + return api_response + + + def _reserved_word_oapg( + self, + skip_deserialization: bool = True, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + """ + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + method = 'get'.upper() + request_before_hook( + resource_path=used_path, + method=method, + configuration=self.api_client.configuration, + auth_settings=_auth, + headers=_headers, + ) + + response = self.api_client.call_api( + resource_path=used_path, + method=method, + headers=_headers, + auth_settings=_auth, + timeout=timeout, + ) + + response_for_status = _status_code_to_response.get(str(response.http_response.status)) + if response_for_status: + api_response = response_for_status.deserialize( + response, + self.api_client.configuration, + skip_deserialization=skip_deserialization + ) + else: + # If response data is JSON then deserialize for SDK consumer convenience + is_json = api_client.JSONDetector._content_type_is_json(response.http_response.headers.get('Content-Type', '')) + api_response = api_client.ApiResponseWithoutDeserialization( + body=json.loads(response.http_response.data) if is_json else response.http_response.data, + response=response.http_response, + round_trip_time=response.round_trip_time, + status=response.http_response.status, + headers=response.http_response.headers, + ) + + if not 200 <= api_response.status <= 299: + raise exceptions.ApiException(api_response=api_response) + + return api_response + + +class ReservedWordRaw(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + async def areserved_word( + self, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._reserved_word_mapped_args( + ) + return await self._areserved_word_oapg( + ) + + def reserved_word( + self, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + args = self._reserved_word_mapped_args( + ) + return self._reserved_word_oapg( + ) + +class ReservedWord(BaseApi): + + async def areserved_word( + self, + validate: bool = False, + ): + raw_response = await self.raw.areserved_word( + ) + if validate: + return TestReservedWordPydantic(**raw_response.body) + return TestReservedWordPydantic.model_construct(**raw_response.body) + + def reserved_word( + self, + validate: bool = False, + ): + raw_response = self.raw.reserved_word( + ) + if validate: + return TestReservedWordPydantic(**raw_response.body) + return TestReservedWordPydantic.model_construct(**raw_response.body) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + async def aget( + self, + ) -> typing.Union[ + ApiResponseFor200Async, + api_client.ApiResponseWithoutDeserializationAsync, + AsyncGeneratorResponse, + ]: + args = self._reserved_word_mapped_args( + ) + return await self._areserved_word_oapg( + ) + + def get( + self, + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: + args = self._reserved_word_mapped_args( + ) + return self._reserved_word_oapg( + ) + diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/__init__.py similarity index 63% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/__init__.py index bb62dd52f..20bb81d81 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/__init__.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/__init__.py @@ -1,7 +1,7 @@ # do not import all endpoints into this module because that uses a lot of memory and stack frames # if you need the ability to import all endpoints from this module, import them with -# from python_dataclass_responses.paths.simple_endpoint import Api +# from python_pydantic.paths.simple_endpoint import Api -from python_dataclass_responses.paths import PathValues +from python_pydantic.paths import PathValues path = PathValues.SIMPLEENDPOINT \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.py similarity index 87% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.py index d19e12d33..0238819f7 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -13,12 +13,12 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from python_dataclass_responses.request_before_hook import request_before_hook +from python_pydantic.request_before_hook import request_before_hook import json from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.api_response import AsyncGeneratorResponse -from python_dataclass_responses import api_client, exceptions +from python_pydantic.api_response import AsyncGeneratorResponse +from python_pydantic import api_client, exceptions from datetime import date, datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 @@ -30,15 +30,19 @@ import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 -from python_dataclass_responses.model.test_fetch400_response import TestFetch400Response as TestFetch400ResponseSchema -from python_dataclass_responses.model.test_fetch500_response import TestFetch500Response as TestFetch500ResponseSchema -from python_dataclass_responses.model.test_fetch_response import TestFetchResponse as TestFetchResponseSchema +from python_pydantic.model.test_fetch_response import TestFetchResponse as TestFetchResponseSchema +from python_pydantic.model.test_fetch400_response import TestFetch400Response as TestFetch400ResponseSchema +from python_pydantic.model.test_fetch500_response import TestFetch500Response as TestFetch500ResponseSchema -from python_dataclass_responses.type.test_fetch500_response import TestFetch500Response -from python_dataclass_responses.type.test_fetch_response import TestFetchResponse -from python_dataclass_responses.type.test_fetch400_response import TestFetch400Response +from python_pydantic.type.test_fetch400_response import TestFetch400Response +from python_pydantic.type.test_fetch500_response import TestFetch500Response +from python_pydantic.type.test_fetch_response import TestFetchResponse + +from python_pydantic.pydantic.test_fetch_response import TestFetchResponse as TestFetchResponsePydantic +from python_pydantic.pydantic.test_fetch500_response import TestFetch500Response as TestFetch500ResponsePydantic +from python_pydantic.pydantic.test_fetch400_response import TestFetch400Response as TestFetch400ResponsePydantic from . import path @@ -349,7 +353,7 @@ class instances return api_response -class Fetch(BaseApi): +class FetchRaw(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names async def afetch( @@ -381,6 +385,33 @@ def fetch( query_params=args.query, ) +class Fetch(BaseApi): + + async def afetch( + self, + input_parameter: str, + validate: bool = False, + ): + raw_response = await self.raw.afetch( + input_parameter=input_parameter, + ) + if validate: + return TestFetchResponsePydantic(**raw_response.body) + return TestFetchResponsePydantic.model_construct(**raw_response.body) + + def fetch( + self, + input_parameter: str, + validate: bool = False, + ): + raw_response = self.raw.fetch( + input_parameter=input_parameter, + ) + if validate: + return TestFetchResponsePydantic(**raw_response.body) + return TestFetchResponsePydantic.model_construct(**raw_response.body) + + class ApiForget(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.pyi b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.pyi similarity index 87% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.pyi rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.pyi index aa629d1bf..4ad049ef3 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/paths/simple_endpoint/get.pyi +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/paths/simple_endpoint/get.pyi @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -13,12 +13,12 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from python_dataclass_responses.request_before_hook import request_before_hook +from python_pydantic.request_before_hook import request_before_hook import json from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.api_response import AsyncGeneratorResponse -from python_dataclass_responses import api_client, exceptions +from python_pydantic.api_response import AsyncGeneratorResponse +from python_pydantic import api_client, exceptions from datetime import date, datetime # noqa: F401 import decimal # noqa: F401 import functools # noqa: F401 @@ -30,15 +30,19 @@ import uuid # noqa: F401 import frozendict # noqa: F401 -from python_dataclass_responses import schemas # noqa: F401 +from python_pydantic import schemas # noqa: F401 -from python_dataclass_responses.model.test_fetch400_response import TestFetch400Response as TestFetch400ResponseSchema -from python_dataclass_responses.model.test_fetch500_response import TestFetch500Response as TestFetch500ResponseSchema -from python_dataclass_responses.model.test_fetch_response import TestFetchResponse as TestFetchResponseSchema +from python_pydantic.model.test_fetch_response import TestFetchResponse as TestFetchResponseSchema +from python_pydantic.model.test_fetch400_response import TestFetch400Response as TestFetch400ResponseSchema +from python_pydantic.model.test_fetch500_response import TestFetch500Response as TestFetch500ResponseSchema -from python_dataclass_responses.type.test_fetch500_response import TestFetch500Response -from python_dataclass_responses.type.test_fetch_response import TestFetchResponse -from python_dataclass_responses.type.test_fetch400_response import TestFetch400Response +from python_pydantic.type.test_fetch400_response import TestFetch400Response +from python_pydantic.type.test_fetch500_response import TestFetch500Response +from python_pydantic.type.test_fetch_response import TestFetchResponse + +from python_pydantic.pydantic.test_fetch_response import TestFetchResponse as TestFetchResponsePydantic +from python_pydantic.pydantic.test_fetch500_response import TestFetch500Response as TestFetch500ResponsePydantic +from python_pydantic.pydantic.test_fetch400_response import TestFetch400Response as TestFetch400ResponsePydantic # Query params InputParameterSchema = schemas.StrSchema @@ -339,7 +343,7 @@ class BaseApi(api_client.Api): return api_response -class Fetch(BaseApi): +class FetchRaw(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names async def afetch( @@ -371,6 +375,33 @@ class Fetch(BaseApi): query_params=args.query, ) +class Fetch(BaseApi): + + async def afetch( + self, + input_parameter: str, + validate: bool = False, + ): + raw_response = await self.raw.afetch( + input_parameter=input_parameter, + ) + if validate: + return TestFetchResponsePydantic(**raw_response.body) + return TestFetchResponsePydantic.model_construct(**raw_response.body) + + def fetch( + self, + input_parameter: str, + validate: bool = False, + ): + raw_response = self.raw.fetch( + input_parameter=input_parameter, + ) + if validate: + return TestFetchResponsePydantic(**raw_response.body) + return TestFetchResponsePydantic.model_construct(**raw_response.body) + + class ApiForget(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/__init__.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/__init__.py diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch400_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch400_response.py new file mode 100644 index 000000000..90f4a00c6 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch400_response.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal +from pydantic import BaseModel, Field + + +class TestFetch400Response(BaseModel): + error: str = Field(None, alias='error') diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch500_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch500_response.py new file mode 100644 index 000000000..3e01e6d64 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch500_response.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal +from pydantic import BaseModel, Field + + +class TestFetch500Response(BaseModel): + error: str = Field(None, alias='error') diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch_response.py new file mode 100644 index 000000000..18cd02c4b --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_fetch_response.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal +from pydantic import BaseModel, Field + + +class TestFetchResponse(BaseModel): + # Description of property A. + property_a: str = Field(None, alias='propertyA') + + # Description of property B. + property_b: int = Field(None, alias='propertyB') + + # Description of property C. + property_c: bool = Field(None, alias='propertyC') diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_reserved_word.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_reserved_word.py new file mode 100644 index 000000000..e84ba413f --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/pydantic/test_reserved_word.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal +from pydantic import BaseModel, Field + + +class TestReservedWord(BaseModel): + # Reserved word in Python + class_: str = Field(None, alias='class') diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_after_hook.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_after_hook.py similarity index 78% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_after_hook.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_after_hook.py index 91d0aaf77..ca74d5de2 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_after_hook.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_after_hook.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,7 +12,7 @@ import typing from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.configuration import Configuration +from python_pydantic.configuration import Configuration def request_after_hook( resource_path: str, diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_hook.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_hook.py similarity index 78% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_hook.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_hook.py index 3673879eb..a06461658 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_hook.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_hook.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,7 +12,7 @@ import typing from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.configuration import Configuration +from python_pydantic.configuration import Configuration def request_before_hook( resource_path: str, diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_url_hook.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_url_hook.py similarity index 79% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_url_hook.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_url_hook.py index b3352607d..8602124fb 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/request_before_url_hook.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/request_before_url_hook.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,7 +12,7 @@ import typing from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.configuration import Configuration +from python_pydantic.configuration import Configuration def request_before_url_hook( resource_path_ref: typing.List[str], diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/rest.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/rest.py similarity index 98% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/rest.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/rest.py index 628f0fa7e..b54722a61 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/rest.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/rest.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -22,7 +22,7 @@ import time from urllib3._collections import HTTPHeaderDict -from python_dataclass_responses.exceptions import ApiException, ApiValueError +from python_pydantic.exceptions import ApiException, ApiValueError logger = logging.getLogger(__name__) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/schemas.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/schemas.py similarity index 99% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/schemas.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/schemas.py index d590ce64e..41441345c 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/schemas.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/schemas.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -24,18 +24,18 @@ from dateutil.parser.isoparser import isoparser, _takes_ascii import frozendict -from python_dataclass_responses.exceptions_base import ( +from python_pydantic.exceptions_base import ( ApiTypeError, ApiValueError, ) -from python_dataclass_responses.configuration import ( +from python_pydantic.configuration import ( Configuration, ) -from python_dataclass_responses.exceptions import SchemaValidationError -from python_dataclass_responses.exceptions import render_path -from python_dataclass_responses.validation_metadata import ValidationMetadata -from python_dataclass_responses.exceptions import AnyOfValidationError -from python_dataclass_responses.exceptions import MissingRequiredPropertiesError +from python_pydantic.exceptions import SchemaValidationError +from python_pydantic.exceptions import render_path +from python_pydantic.validation_metadata import ValidationMetadata +from python_pydantic.exceptions import AnyOfValidationError +from python_pydantic.exceptions import MissingRequiredPropertiesError Primitive: typing_extensions.TypeAlias = typing.Union[int, float, bool, str] diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/test_simple_endpoint/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/__init__.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/test_simple_endpoint/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/__init__.py diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch400_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch400_response.py similarity index 84% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch400_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch400_response.py index 54ca49888..90c91d099 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch400_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch400_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch500_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch500_response.py similarity index 84% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch500_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch500_response.py index 7ed3743da..3239566e1 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch500_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch500_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch_response.py similarity index 87% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch_response.py index 8a10bd728..d3b77b567 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type/test_fetch_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_fetch_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_reserved_word.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_reserved_word.py new file mode 100644 index 000000000..aa657a735 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type/test_reserved_word.py @@ -0,0 +1,28 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +from datetime import datetime, date +import typing +from enum import Enum +from typing_extensions import TypedDict, Literal + + +RequiredTestReservedWord = TypedDict("RequiredTestReservedWord", { + }) + +OptionalTestReservedWord = TypedDict("OptionalTestReservedWord", { + # Reserved word in Python + "class": str, + }, total=False) + +class TestReservedWord(RequiredTestReservedWord, OptionalTestReservedWord): + pass diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type_util.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type_util.py similarity index 84% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type_util.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type_util.py index 689b1cbcb..771df18eb 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/type_util.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/type_util.py @@ -1,7 +1,7 @@ """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/validation_metadata.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/validation_metadata.py similarity index 98% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/validation_metadata.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/validation_metadata.py index 74b314a72..189924bb1 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/python_dataclass_responses/validation_metadata.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/python_pydantic/validation_metadata.py @@ -1,6 +1,6 @@ import frozendict import typing -from python_dataclass_responses.configuration import ( +from python_pydantic.configuration import ( Configuration, ) diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/setup.cfg b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/setup.cfg similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/setup.cfg rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/setup.cfg diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/setup.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/setup.py similarity index 75% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/setup.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/setup.py index d6c82f901..fdbdc324e 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/setup.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/setup.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 -NAME = "python-dataclass-responses-python-sdk" +NAME = "python-pydantic-responses-python-sdk" VERSION = "1.0.0" # To install the library, run the following # @@ -27,22 +27,23 @@ long_description = (this_directory / "README.md").read_text() REQUIRES = [ - "certifi >= 2022.12.7", - "frozendict ~= 2.3.4", + "certifi >= 2023.7.22", "python-dateutil ~= 2.8.2", "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", - "validators ~= 0.20.0",] + "urllib3 ~= 1.26.18", + "frozendict ~= 2.3.4", + "aiohttp ~= 3.8.4", + "pydantic ~= 2.4.2" +] setup( name=NAME, version=VERSION, - description="Python Dataclass Responses API", + description="Python Pydantic Responses API", author="API Support", author_email="support@example.com", url="https://github.com/konfig-dev/konfig/tree/main/python", - keywords=["Konfig", "Python Dataclass Responses API"], - license="MIT", + keywords=["Konfig", "Python Pydantic Responses API"], python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_check_url.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_check_url.py similarity index 91% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_check_url.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_check_url.py index 94d05e049..c010087b4 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_check_url.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_check_url.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -11,8 +11,8 @@ """ import unittest -from python_dataclass_responses.configuration import check_url -from python_dataclass_responses.exceptions import InvalidHostConfigurationError +from python_pydantic.configuration import check_url +from python_pydantic.exceptions import InvalidHostConfigurationError class TestIsValidUrl(unittest.TestCase): diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_deprecation_warning.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_deprecation_warning.py similarity index 90% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_deprecation_warning.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_deprecation_warning.py index e0333bd29..9a203aa96 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_deprecation_warning.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_deprecation_warning.py @@ -1,8 +1,8 @@ import unittest from unittest.mock import patch -from python_dataclass_responses.api_client import ApiClient, DeprecationWarningOnce -from python_dataclass_responses.configuration import Configuration +from python_pydantic.api_client import ApiClient, DeprecationWarningOnce +from python_pydantic.configuration import Configuration class RandomClass: diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch400_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch400_response.py similarity index 55% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch400_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch400_response.py index 6380f687b..012503637 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch400_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch400_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,9 +12,9 @@ import unittest -import python_dataclass_responses -from python_dataclass_responses.model.test_fetch400_response import TestFetch400Response -from python_dataclass_responses import configuration +import python_pydantic +from python_pydantic.model.test_fetch400_response import TestFetch400Response +from python_pydantic import configuration class TestTestFetch400Response(unittest.TestCase): diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch500_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch500_response.py similarity index 55% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch500_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch500_response.py index a200bb56a..a24c56542 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch500_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch500_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,9 +12,9 @@ import unittest -import python_dataclass_responses -from python_dataclass_responses.model.test_fetch500_response import TestFetch500Response -from python_dataclass_responses import configuration +import python_pydantic +from python_pydantic.model.test_fetch500_response import TestFetch500Response +from python_pydantic import configuration class TestTestFetch500Response(unittest.TestCase): diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch_response.py similarity index 55% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch_response.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch_response.py index ccc4a696e..c55d4786d 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_models/test_test_fetch_response.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_fetch_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -12,9 +12,9 @@ import unittest -import python_dataclass_responses -from python_dataclass_responses.model.test_fetch_response import TestFetchResponse -from python_dataclass_responses import configuration +import python_pydantic +from python_pydantic.model.test_fetch_response import TestFetchResponse +from python_pydantic import configuration class TestTestFetchResponse(unittest.TestCase): diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_reserved_word.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_reserved_word.py new file mode 100644 index 000000000..84ab2d8f0 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_models/test_test_reserved_word.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +import unittest + +import python_pydantic +from python_pydantic.model.test_reserved_word import TestReservedWord +from python_pydantic import configuration + + +class TestTestReservedWord(unittest.TestCase): + """TestReservedWord unit test stubs""" + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/__init__.py similarity index 100% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/__init__.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/__init__.py diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/test_get.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/test_get.py new file mode 100644 index 000000000..23bb43e03 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_reserved_word/test_get.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + Python Pydantic Responses API + + A simple API based on python pydantic responses. + + The version of the OpenAPI document: 1.0.0 + Contact: support@example.com + Created by: http://example.com/support +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import python_pydantic +from python_pydantic.paths.reserved_word import get +from python_pydantic import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestReservedWord(ApiTestMixin, unittest.TestCase): + """ + ReservedWord unit test stubs + """ + + def setUp(self): + pass + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/__init__.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/test_simple_endpoint/test_get.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/test_get.py similarity index 68% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/test_simple_endpoint/test_get.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/test_get.py index 8bb893b76..e6baac520 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_paths/test_simple_endpoint/test_get.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_paths/test_simple_endpoint/test_get.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -15,9 +15,9 @@ import urllib3 -import python_dataclass_responses -from python_dataclass_responses.paths.simple_endpoint import get -from python_dataclass_responses import configuration, schemas, api_client +import python_pydantic +from python_pydantic.paths.simple_endpoint import get +from python_pydantic import configuration, schemas, api_client from .. import ApiTestMixin diff --git a/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_pydantic_response.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_pydantic_response.py new file mode 100644 index 000000000..757c7d326 --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_pydantic_response.py @@ -0,0 +1,48 @@ +# coding: utf-8 + + +import unittest + +from python_pydantic import PythonPydanticResponses +from dataclasses import is_dataclass + + +class TestSimple(unittest.TestCase): + def setUp(self): + pass + + def test_response_is_pydantic(self): + client = PythonPydanticResponses( + api_key="YOUR_API_KEY", host="http://127.0.0.1:4011" + ) + response = client.test.fetch("test") + self.assertIsNotNone(response.property_a) + + def test_raw_response(self): + client = PythonPydanticResponses( + api_key="YOUR_API_KEY", host="http://127.0.0.1:4011" + ) + response = client.test.raw.fetch("test") + self.assertIsNotNone(response.body["propertyA"]) + + def test_raw_is_not_pydantic(self): + client = PythonPydanticResponses( + api_key="YOUR_API_KEY", host="http://127.0.0.1:4011" + ) + response = client.test.raw.fetch("test") + self.assertRaises(AttributeError, lambda: response.propertyA) + + # Ensure that reserved words are properly handled by appending _ and aliasing the original name + def test_reserved_word(self): + client = PythonPydanticResponses( + api_key="YOUR_API_KEY", host="http://127.0.0.1:4011" + ) + response = client.test.reserved_word() + self.assertIsNotNone(response.class_) + + def tearDown(self): + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_simple.py b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_simple.py similarity index 62% rename from generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_simple.py rename to generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_simple.py index 92f6de414..063c80c7a 100644 --- a/generator/konfig-integration-tests/sdks/python-dataclass-responses/python/test/test_simple.py +++ b/generator/konfig-integration-tests/sdks/python-pydantic-responses/python/test/test_simple.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Python Dataclass Responses API + Python Pydantic Responses API - A simple API based on python dataclass responses. + A simple API based on python pydantic responses. The version of the OpenAPI document: 1.0.0 Contact: support@example.com @@ -14,18 +14,18 @@ import os from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses +from python_pydantic import PythonPydanticResponses class TestSimple(unittest.TestCase): def setUp(self): pass def test_client(self): - pythondataclassresponses = PythonDataclassResponses( + pythonpydanticresponses = PythonPydanticResponses( api_key = 'YOUR_API_KEY', ) - self.assertIsNotNone(pythondataclassresponses) + self.assertIsNotNone(pythonpydanticresponses) def tearDown(self): pass diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/.konfigignore b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/.konfigignore new file mode 100644 index 000000000..c1c2a235f --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/.konfigignore @@ -0,0 +1 @@ +test/test_typed_dict_response.py \ No newline at end of file diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/poetry.lock b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/poetry.lock index 87f54cb68..ae63e636c 100644 --- a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/poetry.lock +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/poetry.lock @@ -124,6 +124,20 @@ files = [ [package.dependencies] frozenlist = ">=1.1.0" +[[package]] +name = "annotated-types" +version = "0.5.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.7" +files = [ + {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, + {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + [[package]] name = "async-timeout" version = "4.0.3" @@ -1086,6 +1100,143 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydantic" +version = "2.4.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic-2.4.2-py3-none-any.whl", hash = "sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1"}, + {file = "pydantic-2.4.2.tar.gz", hash = "sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.10.1" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.10.1" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:d64728ee14e667ba27c66314b7d880b8eeb050e58ffc5fec3b7a109f8cddbd63"}, + {file = "pydantic_core-2.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:48525933fea744a3e7464c19bfede85df4aba79ce90c60b94d8b6e1eddd67096"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef337945bbd76cce390d1b2496ccf9f90b1c1242a3a7bc242ca4a9fc5993427a"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1392e0638af203cee360495fd2cfdd6054711f2db5175b6e9c3c461b76f5175"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0675ba5d22de54d07bccde38997e780044dcfa9a71aac9fd7d4d7a1d2e3e65f7"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:128552af70a64660f21cb0eb4876cbdadf1a1f9d5de820fed6421fa8de07c893"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f6e6aed5818c264412ac0598b581a002a9f050cb2637a84979859e70197aa9e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ecaac27da855b8d73f92123e5f03612b04c5632fd0a476e469dfc47cd37d6b2e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b3c01c2fb081fced3bbb3da78510693dc7121bb893a1f0f5f4b48013201f362e"}, + {file = "pydantic_core-2.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:92f675fefa977625105708492850bcbc1182bfc3e997f8eecb866d1927c98ae6"}, + {file = "pydantic_core-2.10.1-cp310-none-win32.whl", hash = "sha256:420a692b547736a8d8703c39ea935ab5d8f0d2573f8f123b0a294e49a73f214b"}, + {file = "pydantic_core-2.10.1-cp310-none-win_amd64.whl", hash = "sha256:0880e239827b4b5b3e2ce05e6b766a7414e5f5aedc4523be6b68cfbc7f61c5d0"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:073d4a470b195d2b2245d0343569aac7e979d3a0dcce6c7d2af6d8a920ad0bea"}, + {file = "pydantic_core-2.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:600d04a7b342363058b9190d4e929a8e2e715c5682a70cc37d5ded1e0dd370b4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39215d809470f4c8d1881758575b2abfb80174a9e8daf8f33b1d4379357e417c"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eeb3d3d6b399ffe55f9a04e09e635554012f1980696d6b0aca3e6cf42a17a03b"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a7902bf75779bc12ccfc508bfb7a4c47063f748ea3de87135d433a4cca7a2f"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3625578b6010c65964d177626fde80cf60d7f2e297d56b925cb5cdeda6e9925a"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:caa48fc31fc7243e50188197b5f0c4228956f97b954f76da157aae7f67269ae8"}, + {file = "pydantic_core-2.10.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:07ec6d7d929ae9c68f716195ce15e745b3e8fa122fc67698ac6498d802ed0fa4"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e6f31a17acede6a8cd1ae2d123ce04d8cca74056c9d456075f4f6f85de055607"}, + {file = "pydantic_core-2.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f1ebca515a03e5654f88411420fea6380fc841d1bea08effb28184e3d4899f"}, + {file = "pydantic_core-2.10.1-cp311-none-win32.whl", hash = "sha256:6db2eb9654a85ada248afa5a6db5ff1cf0f7b16043a6b070adc4a5be68c716d6"}, + {file = "pydantic_core-2.10.1-cp311-none-win_amd64.whl", hash = "sha256:4a5be350f922430997f240d25f8219f93b0c81e15f7b30b868b2fddfc2d05f27"}, + {file = "pydantic_core-2.10.1-cp311-none-win_arm64.whl", hash = "sha256:5fdb39f67c779b183b0c853cd6b45f7db84b84e0571b3ef1c89cdb1dfc367325"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:b1f22a9ab44de5f082216270552aa54259db20189e68fc12484873d926426921"}, + {file = "pydantic_core-2.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8572cadbf4cfa95fb4187775b5ade2eaa93511f07947b38f4cd67cf10783b118"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:db9a28c063c7c00844ae42a80203eb6d2d6bbb97070cfa00194dff40e6f545ab"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e2a35baa428181cb2270a15864ec6286822d3576f2ed0f4cd7f0c1708472aff"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05560ab976012bf40f25d5225a58bfa649bb897b87192a36c6fef1ab132540d7"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d6495008733c7521a89422d7a68efa0a0122c99a5861f06020ef5b1f51f9ba7c"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14ac492c686defc8e6133e3a2d9eaf5261b3df26b8ae97450c1647286750b901"}, + {file = "pydantic_core-2.10.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8282bab177a9a3081fd3d0a0175a07a1e2bfb7fcbbd949519ea0980f8a07144d"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:aafdb89fdeb5fe165043896817eccd6434aee124d5ee9b354f92cd574ba5e78f"}, + {file = "pydantic_core-2.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f6defd966ca3b187ec6c366604e9296f585021d922e666b99c47e78738b5666c"}, + {file = "pydantic_core-2.10.1-cp312-none-win32.whl", hash = "sha256:7c4d1894fe112b0864c1fa75dffa045720a194b227bed12f4be7f6045b25209f"}, + {file = "pydantic_core-2.10.1-cp312-none-win_amd64.whl", hash = "sha256:5994985da903d0b8a08e4935c46ed8daf5be1cf217489e673910951dc533d430"}, + {file = "pydantic_core-2.10.1-cp312-none-win_arm64.whl", hash = "sha256:0d8a8adef23d86d8eceed3e32e9cca8879c7481c183f84ed1a8edc7df073af94"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:9badf8d45171d92387410b04639d73811b785b5161ecadabf056ea14d62d4ede"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:ebedb45b9feb7258fac0a268a3f6bec0a2ea4d9558f3d6f813f02ff3a6dc6698"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfe1090245c078720d250d19cb05d67e21a9cd7c257698ef139bc41cf6c27b4f"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e357571bb0efd65fd55f18db0a2fb0ed89d0bb1d41d906b138f088933ae618bb"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3dcd587b69bbf54fc04ca157c2323b8911033e827fffaecf0cafa5a892a0904"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c120c9ce3b163b985a3b966bb701114beb1da4b0468b9b236fc754783d85aa3"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15d6bca84ffc966cc9976b09a18cf9543ed4d4ecbd97e7086f9ce9327ea48891"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5cabb9710f09d5d2e9e2748c3e3e20d991a4c5f96ed8f1132518f54ab2967221"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:82f55187a5bebae7d81d35b1e9aaea5e169d44819789837cdd4720d768c55d15"}, + {file = "pydantic_core-2.10.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1d40f55222b233e98e3921df7811c27567f0e1a4411b93d4c5c0f4ce131bc42f"}, + {file = "pydantic_core-2.10.1-cp37-none-win32.whl", hash = "sha256:14e09ff0b8fe6e46b93d36a878f6e4a3a98ba5303c76bb8e716f4878a3bee92c"}, + {file = "pydantic_core-2.10.1-cp37-none-win_amd64.whl", hash = "sha256:1396e81b83516b9d5c9e26a924fa69164156c148c717131f54f586485ac3c15e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:6835451b57c1b467b95ffb03a38bb75b52fb4dc2762bb1d9dbed8de31ea7d0fc"}, + {file = "pydantic_core-2.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b00bc4619f60c853556b35f83731bd817f989cba3e97dc792bb8c97941b8053a"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa467fd300a6f046bdb248d40cd015b21b7576c168a6bb20aa22e595c8ffcdd"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d99277877daf2efe074eae6338453a4ed54a2d93fb4678ddfe1209a0c93a2468"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa7db7558607afeccb33c0e4bf1c9a9a835e26599e76af6fe2fcea45904083a6"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aad7bd686363d1ce4ee930ad39f14e1673248373f4a9d74d2b9554f06199fb58"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:443fed67d33aa85357464f297e3d26e570267d1af6fef1c21ca50921d2976302"}, + {file = "pydantic_core-2.10.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:042462d8d6ba707fd3ce9649e7bf268633a41018d6a998fb5fbacb7e928a183e"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ecdbde46235f3d560b18be0cb706c8e8ad1b965e5c13bbba7450c86064e96561"}, + {file = "pydantic_core-2.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ed550ed05540c03f0e69e6d74ad58d026de61b9eaebebbaaf8873e585cbb18de"}, + {file = "pydantic_core-2.10.1-cp38-none-win32.whl", hash = "sha256:8cdbbd92154db2fec4ec973d45c565e767ddc20aa6dbaf50142676484cbff8ee"}, + {file = "pydantic_core-2.10.1-cp38-none-win_amd64.whl", hash = "sha256:9f6f3e2598604956480f6c8aa24a3384dbf6509fe995d97f6ca6103bb8c2534e"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:655f8f4c8d6a5963c9a0687793da37b9b681d9ad06f29438a3b2326d4e6b7970"}, + {file = "pydantic_core-2.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e570ffeb2170e116a5b17e83f19911020ac79d19c96f320cbfa1fa96b470185b"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64322bfa13e44c6c30c518729ef08fda6026b96d5c0be724b3c4ae4da939f875"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:485a91abe3a07c3a8d1e082ba29254eea3e2bb13cbbd4351ea4e5a21912cc9b0"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7c2b8eb9fc872e68b46eeaf835e86bccc3a58ba57d0eedc109cbb14177be531"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5cb87bdc2e5f620693148b5f8f842d293cae46c5f15a1b1bf7ceeed324a740c"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:25bd966103890ccfa028841a8f30cebcf5875eeac8c4bde4fe221364c92f0c9a"}, + {file = "pydantic_core-2.10.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f323306d0556351735b54acbf82904fe30a27b6a7147153cbe6e19aaaa2aa429"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0c27f38dc4fbf07b358b2bc90edf35e82d1703e22ff2efa4af4ad5de1b3833e7"}, + {file = "pydantic_core-2.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f1365e032a477c1430cfe0cf2856679529a2331426f8081172c4a74186f1d595"}, + {file = "pydantic_core-2.10.1-cp39-none-win32.whl", hash = "sha256:a1c311fd06ab3b10805abb72109f01a134019739bd3286b8ae1bc2fc4e50c07a"}, + {file = "pydantic_core-2.10.1-cp39-none-win_amd64.whl", hash = "sha256:ae8a8843b11dc0b03b57b52793e391f0122e740de3df1474814c700d2622950a"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:d43002441932f9a9ea5d6f9efaa2e21458221a3a4b417a14027a1d530201ef1b"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:fcb83175cc4936a5425dde3356f079ae03c0802bbdf8ff82c035f8a54b333521"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:962ed72424bf1f72334e2f1e61b68f16c0e596f024ca7ac5daf229f7c26e4208"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2cf5bb4dd67f20f3bbc1209ef572a259027c49e5ff694fa56bed62959b41e1f9"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e544246b859f17373bed915182ab841b80849ed9cf23f1f07b73b7c58baee5fb"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c0877239307b7e69d025b73774e88e86ce82f6ba6adf98f41069d5b0b78bd1bf"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:53df009d1e1ba40f696f8995683e067e3967101d4bb4ea6f667931b7d4a01357"}, + {file = "pydantic_core-2.10.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1254357f7e4c82e77c348dabf2d55f1d14d19d91ff025004775e70a6ef40ada"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:524ff0ca3baea164d6d93a32c58ac79eca9f6cf713586fdc0adb66a8cdeab96a"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f0ac9fb8608dbc6eaf17956bf623c9119b4db7dbb511650910a82e261e6600f"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:320f14bd4542a04ab23747ff2c8a778bde727158b606e2661349557f0770711e"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63974d168b6233b4ed6a0046296803cb13c56637a7b8106564ab575926572a55"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:417243bf599ba1f1fef2bb8c543ceb918676954734e2dcb82bf162ae9d7bd514"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dda81e5ec82485155a19d9624cfcca9be88a405e2857354e5b089c2a982144b2"}, + {file = "pydantic_core-2.10.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:14cfbb00959259e15d684505263d5a21732b31248a5dd4941f73a3be233865b9"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:631cb7415225954fdcc2a024119101946793e5923f6c4d73a5914d27eb3d3a05"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec7dd208a4182e99c5b6c501ce0b1f49de2802448d4056091f8e630b28e9a52"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:149b8a07712f45b332faee1a2258d8ef1fb4a36f88c0c17cb687f205c5dc6e7d"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4d966c47f9dd73c2d32a809d2be529112d509321c5310ebf54076812e6ecd884"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7eb037106f5c6b3b0b864ad226b0b7ab58157124161d48e4b30c4a43fef8bc4b"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:154ea7c52e32dce13065dbb20a4a6f0cc012b4f667ac90d648d36b12007fa9f7"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e562617a45b5a9da5be4abe72b971d4f00bf8555eb29bb91ec2ef2be348cd132"}, + {file = "pydantic_core-2.10.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:f23b55eb5464468f9e0e9a9935ce3ed2a870608d5f534025cd5536bca25b1402"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:e9121b4009339b0f751955baf4543a0bfd6bc3f8188f8056b1a25a2d45099934"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:0523aeb76e03f753b58be33b26540880bac5aa54422e4462404c432230543f33"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e0e2959ef5d5b8dc9ef21e1a305a21a36e254e6a34432d00c72a92fdc5ecda5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da01bec0a26befab4898ed83b362993c844b9a607a86add78604186297eb047e"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f2e9072d71c1f6cfc79a36d4484c82823c560e6f5599c43c1ca6b5cdbd54f881"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f36a3489d9e28fe4b67be9992a23029c3cec0babc3bd9afb39f49844a8c721c5"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f64f82cc3443149292b32387086d02a6c7fb39b8781563e0ca7b8d7d9cf72bd7"}, + {file = "pydantic_core-2.10.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b4a6db486ac8e99ae696e09efc8b2b9fea67b63c8f88ba7a1a16c24a057a0776"}, + {file = "pydantic_core-2.10.1.tar.gz", hash = "sha256:0f8682dbdd2f67f8e1edddcbffcc29f60a6182b4901c367fc8c1c40d30bb0a82"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pygments" version = "2.16.1" @@ -1569,4 +1720,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "02c2989fbb1b73003fa0e92d935e28d376a0cdccd9203516e44cec910c485b40" +content-hash = "6c3c8e668e5534e5423d53ec7e0010528fad1bc013d10f7660f9b15a1e99dbfe" diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/pyproject.toml b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/pyproject.toml index d37213fb1..730cded15 100644 --- a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/pyproject.toml +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/pyproject.toml @@ -15,6 +15,7 @@ typing_extensions = "^4.3.0" urllib3 = "^1.26.18" frozendict = "^2.3.4" aiohttp = "^3.8.4" +pydantic = "^2.4.2" [tool.poetry.group.dev.dependencies] setuptools = "^65.5.1" diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/pydantic/__init__.py b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/python_typeddict/pydantic/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/setup.py b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/setup.py index e71b416ba..2064ee67b 100644 --- a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/setup.py +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/setup.py @@ -27,12 +27,14 @@ long_description = (this_directory / "README.md").read_text() REQUIRES = [ - "certifi >= 2022.12.7", - "frozendict ~= 2.3.4", + "certifi >= 2023.7.22", "python-dateutil ~= 2.8.2", "typing_extensions ~= 4.3.0", - "urllib3 ~= 1.26.7", - "validators ~= 0.20.0",] + "urllib3 ~= 1.26.18", + "frozendict ~= 2.3.4", + "aiohttp ~= 3.8.4", + "pydantic ~= 2.4.2" +] setup( name=NAME, @@ -42,7 +44,6 @@ author_email="support@example.com", url="https://github.com/konfig-dev/konfig/tree/main/python", keywords=["Konfig", "Python TypedDict Responses API"], - license="MIT", python_requires=">=3.7", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), diff --git a/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/test/test_typed_dict_response.py b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/test/test_typed_dict_response.py new file mode 100644 index 000000000..ca111c6be --- /dev/null +++ b/generator/konfig-integration-tests/sdks/python-typeddict-responses/python/test/test_typed_dict_response.py @@ -0,0 +1,25 @@ +# coding: utf-8 + + +import unittest + +from python_typeddict import PythonTypedDictResponses + + +class TestSimple(unittest.TestCase): + def setUp(self): + pass + + def test_response_is_typeddict(self): + client = PythonTypedDictResponses( + api_key="YOUR_API_KEY", host="http://127.0.0.1:4012" + ) + response = client.test.fetch("test") + self.assertIsNotNone(response.body["propertyA"]) + + def tearDown(self): + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/generator/konfig-integration-tests/tests/__snapshots__/python-dataclass-responses.test.ts.snap b/generator/konfig-integration-tests/tests/__snapshots__/python-pydantic-responses.test.ts.snap similarity index 68% rename from generator/konfig-integration-tests/tests/__snapshots__/python-dataclass-responses.test.ts.snap rename to generator/konfig-integration-tests/tests/__snapshots__/python-pydantic-responses.test.ts.snap index 921ef47ae..f527a97d7 100644 --- a/generator/konfig-integration-tests/tests/__snapshots__/python-dataclass-responses.test.ts.snap +++ b/generator/konfig-integration-tests/tests/__snapshots__/python-pydantic-responses.test.ts.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`python-dataclass-responses 1`] = ` -"# python-dataclass-responses-python-sdk +exports[`python-pydantic-responses 1`] = ` +"# python-pydantic-responses-python-sdk -A simple API based on python dataclass responses. +A simple API based on python pydantic responses. -[![PyPI](https://img.shields.io/badge/PyPI-v1.0.0-blue)](https://pypi.org/project/python-dataclass-responses-python-sdk/1.0.0) +[![PyPI](https://img.shields.io/badge/PyPI-v1.0.0-blue)](https://pypi.org/project/python-pydantic-responses-python-sdk/1.0.0) [![README.md](https://img.shields.io/badge/README-Click%20Here-green)](https://github.com/konfig-dev/konfig/tree/main/python#readme) [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](http://example.com/support) @@ -19,7 +19,8 @@ A simple API based on python dataclass responses. - [Getting Started](#getting-started) - [Async](#async) - [Reference](#reference) - * [\`pythondataclassresponses.test.fetch\`](#pythondataclassresponsestestfetch) + * [\`pythonpydanticresponses.test.fetch\`](#pythonpydanticresponsestestfetch) + * [\`pythonpydanticresponses.test.reserved_word\`](#pythonpydanticresponsestestreserved_word) @@ -30,22 +31,22 @@ Python >=3.7 ## Installing \`\`\`sh -pip install python-dataclass-responses-python-sdk==1.0.0 +pip install python-pydantic-responses-python-sdk==1.0.0 \`\`\` ## Getting Started \`\`\`python from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses, ApiException +from python_pydantic import PythonPydanticResponses, ApiException -pythondataclassresponses = PythonDataclassResponses( +pythonpydanticresponses = PythonPydanticResponses( api_key="YOUR_API_KEY", ) try: # Fetches a JSON value based on input parameter - fetch_response = pythondataclassresponses.test.fetch( + fetch_response = pythonpydanticresponses.test.fetch( input_parameter="inputParameter_example", ) pprint(fetch_response.body) @@ -75,9 +76,9 @@ except ApiException as e: \`\`\`python import asyncio from pprint import pprint -from python_dataclass_responses import PythonDataclassResponses, ApiException +from python_pydantic import PythonPydanticResponses, ApiException -pythondataclassresponses = PythonDataclassResponses( +pythonpydanticresponses = PythonPydanticResponses( api_key="YOUR_API_KEY", ) @@ -85,7 +86,7 @@ pythondataclassresponses = PythonDataclassResponses( async def main(): try: # Fetches a JSON value based on input parameter - fetch_response = await pythondataclassresponses.test.afetch( + fetch_response = await pythonpydanticresponses.test.afetch( input_parameter="inputParameter_example", ) pprint(fetch_response.body) @@ -113,14 +114,14 @@ asyncio.run(main()) ## Reference -### \`pythondataclassresponses.test.fetch\` +### \`pythonpydanticresponses.test.fetch\` Provide an input parameter to receive a JSON value with properties. #### 🛠️ Usage \`\`\`python -fetch_response = pythondataclassresponses.test.fetch( +fetch_response = pythonpydanticresponses.test.fetch( input_parameter="inputParameter_example", ) \`\`\` @@ -133,7 +134,7 @@ The input parameter to process. #### 🔄 Return -[TestFetchResponse](./python_dataclass_responses/type/test_fetch_response.py) +[TestFetchResponse](./python_pydantic/type/test_fetch_response.py) #### 🌐 Endpoint @@ -143,6 +144,28 @@ The input parameter to process. --- +### \`pythonpydanticresponses.test.reserved_word\` + +Reserved word in Python + +#### 🛠️ Usage + +\`\`\`python +reserved_word_response = pythonpydanticresponses.test.reserved_word() +\`\`\` + +#### 🔄 Return + +[TestReservedWord](./python_pydantic/type/test_reserved_word.py) + +#### 🌐 Endpoint + +\`/reserved-word\` \`get\` + +[🔙 **Back to Table of Contents**](#table-of-contents) + +--- + ## Author This Python package is automatically generated by [Konfig](https://konfigthis.com) diff --git a/generator/konfig-integration-tests/tests/python-dataclass-responses.test.ts b/generator/konfig-integration-tests/tests/python-pydantic-responses.test.ts similarity index 52% rename from generator/konfig-integration-tests/tests/python-dataclass-responses.test.ts rename to generator/konfig-integration-tests/tests/python-pydantic-responses.test.ts index 3b0955d5e..2242771f1 100644 --- a/generator/konfig-integration-tests/tests/python-dataclass-responses.test.ts +++ b/generator/konfig-integration-tests/tests/python-pydantic-responses.test.ts @@ -1,5 +1,5 @@ import { e2e } from "../util"; -test("python-dataclass-responses", async () => { +test("python-pydantic-responses", async () => { await e2e(4011); });