Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b19f912
Generates separate file for pathparameters
spacether Jul 25, 2023
563f4fc
Adds x_parameters files
spacether Jul 25, 2023
a744766
Fixes typo
spacether Jul 25, 2023
97477d5
Passes body_info into _get_fields_and_body
spacether Jul 25, 2023
defd728
Adds RequestBodyInfo ref linking
spacether Jul 25, 2023
dd00d76
Fixes body types in BodyInfoForX
spacether Jul 26, 2023
0c2f7e7
Fixes one python test
spacether Jul 26, 2023
9ead0dd
Fixes one test
spacether Jul 26, 2023
6a9ab51
Fixes another test
spacether Jul 26, 2023
f973973
Fixes test_body_with_query_params
spacether Jul 26, 2023
b5a7b92
Fixes test_composed_one_of_different_types
spacether Jul 26, 2023
efd60fa
Fixes test_inline_composition
spacether Jul 27, 2023
3c65031
Fixes test_json_patch
spacether Jul 27, 2023
99cc92f
Fixes test_json_with_charset
spacether Jul 27, 2023
d0608fe
Fixes test_mammal, test_missing_or_unset_required_body
spacether Jul 27, 2023
7043129
Fixes two tests
spacether Jul 27, 2023
49a2ceb
Fixes two tests
spacether Jul 27, 2023
482528a
Fixes two tests
spacether Jul 27, 2023
5e63fb0
Fixes two tests
spacether Jul 27, 2023
9088f35
Fixes last python test
spacether Jul 27, 2023
ae63725
Allows body_info to be None
spacether Jul 27, 2023
48130ab
Adds request_body imports for endpoint code sample
spacether Jul 27, 2023
86f6b27
Adds body_info to endpoint docs
spacether Jul 27, 2023
464c20c
Stops generating requestbodyinfo schemas for refed schemas
spacether Jul 27, 2023
7ca1dc9
Dereferences request body schemas
spacether Jul 27, 2023
cc21fcd
Improves refModuleAlias values, prevents collisions based on usages
spacether Jul 27, 2023
029d34a
Samples regenerated
spacether Jul 27, 2023
ee2db6f
Samples actually regenerated
spacether Jul 27, 2023
ba300f6
Fixes test for the nonCOmpliantDiscriminator sample
spacether Jul 27, 2023
76f8fa6
Fixes unit tests
spacether Jul 27, 2023
a1431bd
Runs ensure up to date
spacether Jul 28, 2023
b79a846
Adds content type back in
spacether Jul 28, 2023
b7a3d6a
Adds content type overload condition branch
spacether Jul 28, 2023
c522aed
Adds per content type operation overloads
spacether Jul 28, 2023
b8c9121
Removes unused getContentTypeToOperation, adds requestBodySchema
spacether Jul 28, 2023
30cabbb
Adds and sets requestBodySchema in CodegenOperation
spacether Jul 28, 2023
518c936
Uses a linkedhashmap to store properties before making requestBodySchema
spacether Jul 28, 2023
6017af3
Uses requestBodySchema.properties to define type hints for operation …
spacether Jul 28, 2023
ee3d00f
Adds request body schema imports at the top of the operation file
spacether Jul 28, 2023
a47cdef
Adds body type hints for operation
spacether Jul 29, 2023
cc152fb
Switches code back to using body + content_type
spacether Jul 29, 2023
5a1d211
FIxes two tests
spacether Jul 29, 2023
0643014
Runs black on file, fixes three tests
spacether Jul 29, 2023
09e0c9c
Fixes 3 tests
spacether Jul 29, 2023
205ff44
Fixes 3 more tests
spacether Jul 29, 2023
a55d78d
Updates operation variable names
spacether Jul 29, 2023
14f4e04
Fixes body schema input type to use refModuleAlias, samples regen
spacether Jul 31, 2023
1d2b216
FIxes unitt est specs
spacether Jul 31, 2023
0efc229
Updates templates to remove RequestBodyInfo
spacether Jul 31, 2023
f77f11d
Samples regenerated
spacether Jul 31, 2023
2e9e67d
Updates operation to directly import query cookie header path param s…
spacether Jul 31, 2023
4276df0
Sets skip_validation to True in _get_used_path
spacether Jul 31, 2023
cc5ac7b
FIxes mypy type errors, improves request body typing
spacether Jul 31, 2023
2893dc0
Samples regen
spacether Jul 31, 2023
efb69c5
Fixes typo
spacether Jul 31, 2023
dbd22bf
Removes unused doc import
spacether Jul 31, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adds body type hints for operation
  • Loading branch information
spacether committed Jul 29, 2023
commit a47cdef00b98633cf9278d88c4dcf2382440c19e
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from petstore_api import api_client
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.components.request_bodies.request_body_client.content.application_json import schema
from petstore_api.components.schema import client

from .. import path
from .responses import response_200
Expand Down Expand Up @@ -35,7 +35,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _call_123_test__special_tags(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -48,7 +51,10 @@ def _call_123_test__special_tags(
@typing.overload
def _call_123_test__special_tags(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -60,7 +66,10 @@ def _call_123_test__special_tags(

def _call_123_test__special_tags(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ class BaseApi(api_client.Api):
@typing.overload
def _enum_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schemas.Unset,
schema.SchemaDict,
] = schemas.unset,
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict,
Expand All @@ -88,7 +92,11 @@ def _enum_parameters(
@typing.overload
def _enum_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schemas.Unset,
schema.SchemaDict,
] = schemas.unset,
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict,
Expand All @@ -110,7 +118,11 @@ def _enum_parameters(

def _enum_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schema.SchemaDict,
schemas.Unset,
] = schemas.unset,
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from petstore_api import api_client
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.components.request_bodies.request_body_client.content.application_json import schema
from petstore_api.components.schema import client

from .. import path
from .responses import response_200
Expand Down Expand Up @@ -35,7 +35,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _client_model(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -48,7 +51,10 @@ def _client_model(
@typing.overload
def _client_model(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -60,7 +66,10 @@ def _client_model(

def _client_model(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class BaseApi(api_client.Api):
@typing.overload
def _endpoint_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schemas.Unset,
schema.SchemaDict,
] = schemas.unset,
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = "application/x-www-form-urlencoded",
Expand All @@ -57,7 +61,11 @@ def _endpoint_parameters(
@typing.overload
def _endpoint_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schemas.Unset,
schema.SchemaDict,
] = schemas.unset,
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = "application/x-www-form-urlencoded",
Expand All @@ -69,7 +77,11 @@ def _endpoint_parameters(

def _endpoint_parameters(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
schema.SchemaDictInput,
schema.SchemaDict,
schemas.Unset,
] = schemas.unset,
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/x-www-form-urlencoded"] = "application/x-www-form-urlencoded",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from petstore_api import api_client
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.paths.fake_additional_properties_with_array_of_enums.get.request_body.content.application_json import schema
from petstore_api.components.schema import additional_properties_with_array_of_enums

from .. import path
from .responses import response_200
Expand Down Expand Up @@ -35,7 +35,11 @@ class BaseApi(api_client.Api):
@typing.overload
def _additional_properties_with_array_of_enums(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDictInput,
schemas.Unset,
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDict,
] = schemas.unset,
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -48,7 +52,11 @@ def _additional_properties_with_array_of_enums(
@typing.overload
def _additional_properties_with_array_of_enums(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDictInput,
schemas.Unset,
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDict,
] = schemas.unset,
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -60,7 +68,11 @@ def _additional_properties_with_array_of_enums(

def _additional_properties_with_array_of_enums(
self,
body_info: typing.Optional[request_body.RequestBodyInfo] = None,
body: typing.Union[
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDictInput,
additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnumsDict,
schemas.Unset,
] = schemas.unset,
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from petstore_api import api_client
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.paths.fake_body_with_file_schema.put.request_body.content.application_json import schema
from petstore_api.components.schema import file_schema_test_class

from .. import path
from .responses import response_200
Expand All @@ -31,7 +31,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _body_with_file_schema(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
file_schema_test_class.FileSchemaTestClassDictInput,
file_schema_test_class.FileSchemaTestClassDict,
],
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -43,7 +46,10 @@ def _body_with_file_schema(
@typing.overload
def _body_with_file_schema(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
file_schema_test_class.FileSchemaTestClassDictInput,
file_schema_test_class.FileSchemaTestClassDict,
],
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -54,7 +60,10 @@ def _body_with_file_schema(

def _body_with_file_schema(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
file_schema_test_class.FileSchemaTestClassDictInput,
file_schema_test_class.FileSchemaTestClassDict,
],
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from petstore_api.shared_imports.schema_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api import api_client
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.paths.fake_body_with_query_params.put.request_body.content.application_json import schema
from petstore_api.components.schema import user

from .. import path
from .responses import response_200
Expand Down Expand Up @@ -38,7 +38,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _body_with_query_params(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
user.UserDictInput,
user.UserDict,
],
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict
Expand All @@ -54,7 +57,10 @@ def _body_with_query_params(
@typing.overload
def _body_with_query_params(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
user.UserDictInput,
user.UserDict,
],
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict
Expand All @@ -69,7 +75,10 @@ def _body_with_query_params(

def _body_with_query_params(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
user.UserDictInput,
user.UserDict,
],
query_params: typing.Union[
query_parameters.QueryParametersDictInput,
query_parameters.QueryParametersDict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from petstore_api import api_client, security_schemes
from petstore_api.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from petstore_api.components.request_bodies.request_body_client.content.application_json import schema
from petstore_api.components.schema import client

from .. import path
from .responses import response_200
Expand Down Expand Up @@ -40,7 +40,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _classname(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -54,7 +57,10 @@ def _classname(
@typing.overload
def _classname(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -67,7 +73,10 @@ def _classname(

def _classname(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
client.ClientDictInput,
client.ClientDict,
],
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ class BaseApi(api_client.Api):
@typing.overload
def _inline_additional_properties(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
schema.SchemaDictInput,
schema.SchemaDict,
],
*,
skip_deserialization: typing_extensions.Literal[False] = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -43,7 +46,10 @@ def _inline_additional_properties(
@typing.overload
def _inline_additional_properties(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
schema.SchemaDictInput,
schema.SchemaDict,
],
*,
skip_deserialization: typing_extensions.Literal[True],
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand All @@ -54,7 +60,10 @@ def _inline_additional_properties(

def _inline_additional_properties(
self,
body_info: request_body.RequestBodyInfo,
body: typing.Union[
schema.SchemaDictInput,
schema.SchemaDict,
],
*,
skip_deserialization: bool = False,
content_type: typing_extensions.Literal["application/json"] = "application/json",
Expand Down
Loading