ab-openapi-python-generator 2.2.1__py3-none-any.whl → 2.2.2__py3-none-any.whl
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.
- ab_openapi_python_generator/language_converters/python/templates/async_client_httpx_pydantic_2.jinja2 +5 -5
- ab_openapi_python_generator/language_converters/python/templates/sync_client_httpx_pydantic_2.jinja2 +5 -5
- ab_openapi_python_generator/models.py +0 -15
- {ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/METADATA +1 -1
- {ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/RECORD +8 -8
- {ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/WHEEL +0 -0
- {ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/entry_points.txt +0 -0
- {ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
from typing import Any, Dict, Optional, Union
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
|
-
from pydantic import BaseModel
|
|
6
|
+
from pydantic import BaseModel, HttpUrl
|
|
7
7
|
|
|
8
8
|
from ..models import *
|
|
9
|
-
{% set
|
|
9
|
+
{% set _base_url = servers[0].url if servers|length > 0 else "/" %}
|
|
10
10
|
from ..exceptions import HTTPException
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class AsyncClient(BaseModel):
|
|
14
14
|
model_config = {"validate_assignment": True}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
base_url: str = "{{ _base_url }}"
|
|
17
17
|
verify: Union[bool, str] = True
|
|
18
18
|
{% if env_token_name is none %}
|
|
19
19
|
access_token: Optional[str] = None
|
|
@@ -41,7 +41,7 @@ class AsyncClient(BaseModel):
|
|
|
41
41
|
|
|
42
42
|
{% for op in operations %}
|
|
43
43
|
async def {{ op.operation_id }}(self{% if op.params %}, {{ op.params }}{% endif %}) -> Any:
|
|
44
|
-
|
|
44
|
+
base_url = self.base_url
|
|
45
45
|
path = f"{{ op.path_name }}"
|
|
46
46
|
|
|
47
47
|
headers = {
|
|
@@ -57,7 +57,7 @@ class AsyncClient(BaseModel):
|
|
|
57
57
|
}
|
|
58
58
|
query_params = {k: v for (k, v) in query_params.items() if v is not None}
|
|
59
59
|
|
|
60
|
-
async with httpx.AsyncClient(base_url=
|
|
60
|
+
async with httpx.AsyncClient(base_url=base_url, verify=self.verify) as client:
|
|
61
61
|
response = await client.request(
|
|
62
62
|
"{{ op.method }}",
|
|
63
63
|
httpx.URL(path),
|
ab_openapi_python_generator/language_converters/python/templates/sync_client_httpx_pydantic_2.jinja2
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
from typing import Any, Dict, Optional, Union
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
|
-
from pydantic import BaseModel
|
|
6
|
+
from pydantic import BaseModel, HttpUrl
|
|
7
7
|
|
|
8
8
|
from ..models import *
|
|
9
|
-
{% set
|
|
9
|
+
{% set _base_url = servers[0].url if servers|length > 0 else "/" %}
|
|
10
10
|
from ..exceptions import HTTPException
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class SyncClient(BaseModel):
|
|
14
14
|
model_config = {"validate_assignment": True}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
base_url: str = "{{ _base_url }}"
|
|
17
17
|
verify: Union[bool, str] = True
|
|
18
18
|
{% if env_token_name is none %}
|
|
19
19
|
access_token: Optional[str] = None
|
|
@@ -41,7 +41,7 @@ class SyncClient(BaseModel):
|
|
|
41
41
|
|
|
42
42
|
{% for op in operations %}
|
|
43
43
|
def {{ op.operation_id }}(self{% if op.params %}, {{ op.params }}{% endif %}) -> Any:
|
|
44
|
-
|
|
44
|
+
base_url = self.base_url
|
|
45
45
|
path = f"{{ op.path_name }}"
|
|
46
46
|
|
|
47
47
|
headers = {
|
|
@@ -57,7 +57,7 @@ class SyncClient(BaseModel):
|
|
|
57
57
|
}
|
|
58
58
|
query_params = {k: v for (k, v) in query_params.items() if v is not None}
|
|
59
59
|
|
|
60
|
-
with httpx.Client(base_url=
|
|
60
|
+
with httpx.Client(base_url=base_url, verify=self.verify) as client:
|
|
61
61
|
response = client.request(
|
|
62
62
|
"{{ op.method }}",
|
|
63
63
|
httpx.URL(path),
|
|
@@ -80,21 +80,6 @@ class Model(BaseModel):
|
|
|
80
80
|
properties: List[Property] = []
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
class Service(BaseModel):
|
|
84
|
-
file_name: str
|
|
85
|
-
operations: List[ServiceOperation]
|
|
86
|
-
content: str
|
|
87
|
-
async_client: Optional[bool] = False
|
|
88
|
-
library_import: str
|
|
89
|
-
use_orjson: bool = False
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class APIConfig(BaseModel):
|
|
93
|
-
file_name: str
|
|
94
|
-
base_url: str
|
|
95
|
-
content: str
|
|
96
|
-
|
|
97
|
-
|
|
98
83
|
class ConversionResult(BaseModel):
|
|
99
84
|
models: List[Model] = Field(default_factory=list)
|
|
100
85
|
clients: List[Model] = Field(default_factory=list)
|
{ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ab-openapi-python-generator
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Openapi Python Generator
|
|
5
5
|
Project-URL: Homepage, https://github.com/auth-broker/openapi-python-generator
|
|
6
6
|
Project-URL: Repository, https://github.com/auth-broker/openapi-python-generator
|
{ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/RECORD
RENAMED
|
@@ -2,7 +2,7 @@ ab_openapi_python_generator/__init__.py,sha256=ph2EznAu4nkHFruaG542m4TQ_xAvDlf36
|
|
|
2
2
|
ab_openapi_python_generator/__main__.py,sha256=Vz0FsBvxQtyozKkZZFK_ag8XgJcx-5obRm44ogjD0Wk,2500
|
|
3
3
|
ab_openapi_python_generator/common.py,sha256=rh6AxoWyL-jb5WbeLhiohvFUBUnevn4N7ixHPKTIiDM,1221
|
|
4
4
|
ab_openapi_python_generator/generate_data.py,sha256=s71eWNKqEv5_v0Tfb2jnIME-JOag_Jz9gKxMGT5Veq8,7944
|
|
5
|
-
ab_openapi_python_generator/models.py,sha256=
|
|
5
|
+
ab_openapi_python_generator/models.py,sha256=pkuEbp4FrLhgoTzEZKnCVYBBvefX1oMJdbKAoMDTHfA,2031
|
|
6
6
|
ab_openapi_python_generator/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
ab_openapi_python_generator/version_detector.py,sha256=PUDTpgDMHljUzxhLhMrCzHMdS3mgYQibWDiI4-vLRB4,2104
|
|
8
8
|
ab_openapi_python_generator/language_converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -14,18 +14,18 @@ ab_openapi_python_generator/language_converters/python/generator.py,sha256=g-WTV
|
|
|
14
14
|
ab_openapi_python_generator/language_converters/python/jinja_config.py,sha256=EsASthmgh_XrwR7GiDooTyTiiIoqScz9HymvUpNBYFY,1210
|
|
15
15
|
ab_openapi_python_generator/language_converters/python/model_generator.py,sha256=RoHO-R-fgmBL1osmzIoPEmYAUg-9BxUSThFSbUvQYoA,34543
|
|
16
16
|
ab_openapi_python_generator/language_converters/python/templates/alias_union.jinja2,sha256=tndnrDky4srNRyB_HnUMZFW7HtoJvEfwIFteYIu0ELc,468
|
|
17
|
-
ab_openapi_python_generator/language_converters/python/templates/async_client_httpx_pydantic_2.jinja2,sha256=
|
|
17
|
+
ab_openapi_python_generator/language_converters/python/templates/async_client_httpx_pydantic_2.jinja2,sha256=U3O0BxYmbbQqmYKA1lctdd61I9f4BatF6_NgW2EOoz0,2417
|
|
18
18
|
ab_openapi_python_generator/language_converters/python/templates/discriminator_enum.jinja2,sha256=GJZ_ih1eURnJRPZq5P_3aKhYB5iJHymj2fpuNSdM90Y,163
|
|
19
19
|
ab_openapi_python_generator/language_converters/python/templates/enum.jinja2,sha256=7dewyMLifUTe9xjCTE62deuncPiNkp7eGkIaY-IWsLo,263
|
|
20
20
|
ab_openapi_python_generator/language_converters/python/templates/http_exception.jinja2,sha256=BHy48PD74aU74NGWC98iciacmGotHuWw9CaOqnCL8Kc,294
|
|
21
21
|
ab_openapi_python_generator/language_converters/python/templates/models.jinja2,sha256=s5PllbxiEENsZ5_fKSh1gKMJWhcLfBdH5744nKnAZsQ,797
|
|
22
22
|
ab_openapi_python_generator/language_converters/python/templates/models_pydantic_2.jinja2,sha256=o6-OlV5upoZOAVx6aQbsaigPMTCi4Uuec-oP1FNDJ60,904
|
|
23
|
-
ab_openapi_python_generator/language_converters/python/templates/sync_client_httpx_pydantic_2.jinja2,sha256=
|
|
23
|
+
ab_openapi_python_generator/language_converters/python/templates/sync_client_httpx_pydantic_2.jinja2,sha256=aZlljl0OD5PLrGIn4MujZkhZG6XAvoPMvLEmIDWQhdc,2393
|
|
24
24
|
ab_openapi_python_generator/parsers/__init__.py,sha256=UITDIV7rp3HAA1M8kQc_9cNG6e1tS2vDa4mTKua6aMY,300
|
|
25
25
|
ab_openapi_python_generator/parsers/openapi_30.py,sha256=2Hq5Vl3V4NUHKol-OO2nmt8-Fh6Lqk-hJUys8s-4UNI,1924
|
|
26
26
|
ab_openapi_python_generator/parsers/openapi_31.py,sha256=jyKYAKDRkqKUPSeP6xZuM6ZCE0JjuowAe_pbm01iqWE,1924
|
|
27
|
-
ab_openapi_python_generator-2.2.
|
|
28
|
-
ab_openapi_python_generator-2.2.
|
|
29
|
-
ab_openapi_python_generator-2.2.
|
|
30
|
-
ab_openapi_python_generator-2.2.
|
|
31
|
-
ab_openapi_python_generator-2.2.
|
|
27
|
+
ab_openapi_python_generator-2.2.2.dist-info/METADATA,sha256=Tx3Q2kw6jYYS9ifWRrkdWzQ1zv8F02bzPgeAmJv9Gyw,5186
|
|
28
|
+
ab_openapi_python_generator-2.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
29
|
+
ab_openapi_python_generator-2.2.2.dist-info/entry_points.txt,sha256=zezbCs2qP8lSUbcjL6cN5XHoHxf9JTe15CZYH8Yuzo0,90
|
|
30
|
+
ab_openapi_python_generator-2.2.2.dist-info/licenses/LICENSE,sha256=0myanGwJ2vUOZN12aN95o0My6XEysnnVlbKikYw3pHg,1070
|
|
31
|
+
ab_openapi_python_generator-2.2.2.dist-info/RECORD,,
|
{ab_openapi_python_generator-2.2.1.dist-info → ab_openapi_python_generator-2.2.2.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|