Skip to content

Commit 41caec2

Browse files
committed
Sample regen
1 parent 030fa1b commit 41caec2

File tree

201 files changed

+290
-1019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+290
-1019
lines changed

petstore/openapi_json_schema_generator_python/.openapi-generator/FILES

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.gitignore
22
.gitlab-ci.yml
3-
.openapi-generator-ignore
43
.travis.yml
54
README.md
65
docs/apis/tags/pet_api.md
@@ -366,12 +365,6 @@ test-requirements.txt
366365
test/__init__.py
367366
test/components/__init__.py
368367
test/components/schema/__init__.py
369-
test/components/schema/test_api_response.py
370-
test/components/schema/test_category.py
371-
test/components/schema/test_order.py
372-
test/components/schema/test_pet.py
373-
test/components/schema/test_tag.py
374-
test/components/schema/test_user.py
375368
test/test_paths/__init__.py
376369
test/test_paths/__init__.py
377370
test/test_paths/__init__.py

petstore/openapi_json_schema_generator_python/src/openapi_client/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
"""
66
OpenAPI Petstore
7-
87
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
9-
108
The version of the OpenAPI document: 1.0.0
119
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
1210
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/api_client.py

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# coding: utf-8
22
"""
33
OpenAPI Petstore
4-
54
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
6-
75
The version of the OpenAPI document: 1.0.0
86
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
97
"""
@@ -1156,6 +1154,86 @@ class Api(TypedDictInputVerifier):
11561154
"""
11571155
api_client: ApiClient = dataclasses.field(default_factory=lambda: ApiClient())
11581156

1157+
@staticmethod
1158+
def _get_used_path(
1159+
used_path: str,
1160+
path_parameters: typing.Tuple[typing.Type[PathParameter], ...] = (),
1161+
path_params: typing.Dict[str, typing.Any] = frozendict.frozendict(),
1162+
query_parameters: typing.Tuple[typing.Type[QueryParameter], ...] = (),
1163+
query_params: typing.Dict[str, typing.Any] = frozendict.frozendict(),
1164+
) -> str:
1165+
used_path_params = {}
1166+
for parameter in path_parameters:
1167+
parameter_data = path_params.get(parameter.name, schemas.unset)
1168+
if parameter_data is schemas.unset:
1169+
continue
1170+
serialized_data = parameter.serialize(parameter_data)
1171+
used_path_params.update(serialized_data)
1172+
1173+
for k, v in used_path_params.items():
1174+
used_path = used_path.replace('{%s}' % k, v)
1175+
1176+
prefix_separator_iterator = None
1177+
for parameter in query_parameters:
1178+
parameter_data = query_params.get(parameter.name, schemas.unset)
1179+
if parameter_data is schemas.unset:
1180+
continue
1181+
if prefix_separator_iterator is None:
1182+
prefix_separator_iterator = parameter.get_prefix_separator_iterator()
1183+
serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator)
1184+
for serialized_value in serialized_data.values():
1185+
used_path += serialized_value
1186+
return used_path
1187+
1188+
@staticmethod
1189+
def _get_headers(
1190+
header_parameters: typing.Tuple[typing.Type[HeaderParameter], ...] = (),
1191+
header_params: typing.Dict[str, typing.Any] = frozendict.frozendict(),
1192+
accept_content_types: typing.Tuple[str] = (),
1193+
) -> _collections.HTTPHeaderDict:
1194+
headers = _collections.HTTPHeaderDict()
1195+
for parameter in header_parameters:
1196+
parameter_data = header_params.get(parameter.name, schemas.unset)
1197+
if parameter_data is schemas.unset:
1198+
continue
1199+
serialized_data = parameter.serialize(parameter_data)
1200+
headers.extend(serialized_data)
1201+
if accept_content_types:
1202+
for accept_content_type in accept_content_types:
1203+
headers.add('Accept', accept_content_type)
1204+
return headers
1205+
1206+
@staticmethod
1207+
def _get_fields_and_body(
1208+
request_body: 'RequestBody',
1209+
body: typing.Any,
1210+
headers: _collections.HTTPHeaderDict,
1211+
content_type: str
1212+
):
1213+
if request_body.required and body is schemas.unset:
1214+
raise exceptions.ApiValueError(
1215+
'The required body parameter has an invalid value of: unset. Set a valid value instead')
1216+
_fields = None
1217+
_body = None
1218+
1219+
if request_body.required or ((not request_body.required) and body is not schemas.unset):
1220+
serialized_data = request_body.serialize(body, content_type)
1221+
headers.add('Content-Type', content_type)
1222+
if 'fields' in serialized_data:
1223+
_fields = serialized_data['fields']
1224+
elif 'body' in serialized_data:
1225+
_body = serialized_data['body']
1226+
return _fields, _body
1227+
1228+
@staticmethod
1229+
def _verify_response_status(api_response: 'ApiResponse'):
1230+
if not 200 <= api_response.response.status <= 399:
1231+
raise exceptions.ApiException(
1232+
status=api_response.response.status,
1233+
reason=api_response.response.reason,
1234+
api_response=api_response
1235+
)
1236+
11591237

11601238
class SerializedRequestBody(typing_extensions.TypedDict, total=False):
11611239
body: typing.Union[str, bytes]

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/pet.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/pet_find_by_status.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/pet_find_by_tags.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/pet_pet_id.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/pet_pet_id_upload_image.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/store_inventory.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/store_order.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/store_order_order_id.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user_create_with_array.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user_create_with_list.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user_login.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user_logout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/paths/user_username.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/tags/pet_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/tags/store_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/apis/tags/user_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

petstore/openapi_json_schema_generator_python/src/openapi_client/components/request_bodies/request_body_pet/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

9-
import typing
10-
import typing_extensions
7+
import typing, typing_extensions
118

129
from openapi_client import api_client
1310
from .content.application_json import schema as application_json_schema

petstore/openapi_json_schema_generator_python/src/openapi_client/components/request_bodies/request_body_pet/content/application_json/schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/request_bodies/request_body_pet/content/application_xml/schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/request_bodies/request_body_user_array/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# coding: utf-8
22

33
"""
4-
5-
64
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
75
"""
86

9-
import typing
10-
import typing_extensions
7+
import typing, typing_extensions
118

129
from openapi_client import api_client
1310
from .content.application_json import schema as application_json_schema

petstore/openapi_json_schema_generator_python/src/openapi_client/components/request_bodies/request_body_user_array/content/application_json/schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/api_response.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/category.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/order.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/pet.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/tag.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

petstore/openapi_json_schema_generator_python/src/openapi_client/components/schema/user.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
"""
44
OpenAPI Petstore
5-
65
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. # noqa: E501
7-
86
The version of the OpenAPI document: 1.0.0
97
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
108
"""

0 commit comments

Comments
 (0)