pydantic-openapi-generator 2.6.0__tar.gz → 2.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/PKG-INFO +1 -1
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/pyproject.toml +1 -1
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/async_client_httpx_pydantic_2.jinja2 +5 -4
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/sync_client_httpx_pydantic_2.jinja2 +5 -4
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/.gitignore +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/LICENSE +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/README.md +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/__init__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/__main__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/common.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/__init__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/base_parameter.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/class_var_parameter.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/function_parameter.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/generator_config.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/kwarg_parameter.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/loader.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/parameter_source.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/parameter_union.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/config/utils.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/generate_data.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/__init__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/__init__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/client_generator.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/common.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/exception_generator.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/generator.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/jinja_config.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/model_generator.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/alias_union.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/discriminator_enum.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/enum.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/http_exception.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/models.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/language_converters/python/templates/models_pydantic_2.jinja2 +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/models.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/parsers/__init__.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/parsers/openapi_30.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/parsers/openapi_31.py +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/py.typed +0 -0
- {pydantic_openapi_generator-2.6.0 → pydantic_openapi_generator-2.7.0}/src/pydantic_openapi_generator/version_detector.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pydantic-openapi-generator
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.0
|
|
4
4
|
Summary: Openapi Python Generator
|
|
5
5
|
Project-URL: Homepage, https://github.com/mattcoulter7/pydantic-openapi-generator
|
|
6
6
|
Project-URL: Repository, https://github.com/mattcoulter7/pydantic-openapi-generator
|
|
@@ -7,7 +7,7 @@ from typing import Any, Dict, Optional, Union
|
|
|
7
7
|
import json
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
|
-
from pydantic import BaseModel, SecretStr, TypeAdapter
|
|
10
|
+
from pydantic import BaseModel, Field, SecretStr, TypeAdapter
|
|
11
11
|
|
|
12
12
|
from ..models import *
|
|
13
13
|
|
|
@@ -15,10 +15,11 @@ from ..models import *
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class AsyncClient(BaseModel):
|
|
18
|
-
model_config = {"validate_assignment": True}
|
|
18
|
+
model_config = {"validate_assignment": True, "arbitrary_types_allowed": True}
|
|
19
19
|
|
|
20
20
|
base_url: str = "{{ _base_url }}"
|
|
21
21
|
verify: Union[bool, str] = True
|
|
22
|
+
timeout: Union[float, httpx.Timeout, None] = Field(default_factory=lambda: httpx.Timeout(5.0))
|
|
22
23
|
{% if env_token_name is none %}
|
|
23
24
|
access_token: Optional[str] = None
|
|
24
25
|
{% endif %}
|
|
@@ -100,7 +101,7 @@ AsyncGenerator[str | {% if op.sse_data_handler and op.sse_data_handler.type %}{%
|
|
|
100
101
|
query_params = {k: v for (k, v) in query_params.items() if v is not None}
|
|
101
102
|
|
|
102
103
|
{% if op.is_sse %}
|
|
103
|
-
async with httpx.AsyncClient(base_url=base_url, verify=self.verify) as client:
|
|
104
|
+
async with httpx.AsyncClient(base_url=base_url, verify=self.verify, timeout=self.timeout) as client:
|
|
104
105
|
async with client.stream(
|
|
105
106
|
"{{ op.method }}",
|
|
106
107
|
httpx.URL(path),
|
|
@@ -148,7 +149,7 @@ AsyncGenerator[str | {% if op.sse_data_handler and op.sse_data_handler.type %}{%
|
|
|
148
149
|
# Non-data lines: yield as raw text for debugging/visibility
|
|
149
150
|
yield line
|
|
150
151
|
{% else %}
|
|
151
|
-
async with httpx.AsyncClient(base_url=base_url, verify=self.verify) as client:
|
|
152
|
+
async with httpx.AsyncClient(base_url=base_url, verify=self.verify, timeout=self.timeout) as client:
|
|
152
153
|
response = await client.request(
|
|
153
154
|
"{{ op.method }}",
|
|
154
155
|
httpx.URL(path),
|
|
@@ -7,7 +7,7 @@ from typing import Any, Dict, Optional, Union
|
|
|
7
7
|
import json
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
|
-
from pydantic import BaseModel, SecretStr, TypeAdapter
|
|
10
|
+
from pydantic import BaseModel, Field, SecretStr, TypeAdapter
|
|
11
11
|
|
|
12
12
|
from ..models import *
|
|
13
13
|
|
|
@@ -15,10 +15,11 @@ from ..models import *
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class SyncClient(BaseModel):
|
|
18
|
-
model_config = {"validate_assignment": True}
|
|
18
|
+
model_config = {"validate_assignment": True, "arbitrary_types_allowed": True}
|
|
19
19
|
|
|
20
20
|
base_url: str = "{{ _base_url }}"
|
|
21
21
|
verify: Union[bool, str] = True
|
|
22
|
+
timeout: Union[float, httpx.Timeout, None] = Field(default_factory=lambda: httpx.Timeout(5.0))
|
|
22
23
|
{% if env_token_name is none %}
|
|
23
24
|
access_token: Optional[str] = None
|
|
24
25
|
{% endif %}
|
|
@@ -100,7 +101,7 @@ Generator[str | {% if op.sse_data_handler and op.sse_data_handler.type %}{% if o
|
|
|
100
101
|
query_params = {k: v for (k, v) in query_params.items() if v is not None}
|
|
101
102
|
|
|
102
103
|
{% if op.is_sse %}
|
|
103
|
-
with httpx.Client(base_url=base_url, verify=self.verify) as client:
|
|
104
|
+
with httpx.Client(base_url=base_url, verify=self.verify, timeout=self.timeout) as client:
|
|
104
105
|
with client.stream(
|
|
105
106
|
"{{ op.method }}",
|
|
106
107
|
httpx.URL(path),
|
|
@@ -147,7 +148,7 @@ Generator[str | {% if op.sse_data_handler and op.sse_data_handler.type %}{% if o
|
|
|
147
148
|
else:
|
|
148
149
|
yield line
|
|
149
150
|
{% else %}
|
|
150
|
-
with httpx.Client(base_url=base_url, verify=self.verify) as client:
|
|
151
|
+
with httpx.Client(base_url=base_url, verify=self.verify, timeout=self.timeout) as client:
|
|
151
152
|
response = client.request(
|
|
152
153
|
"{{ op.method }}",
|
|
153
154
|
httpx.URL(path),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|