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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ public boolean getHasDefaultResponse() {
return responses.stream().anyMatch(response -> response.isDefault);
}

public boolean getAllResponsesAreErrors() {
return responses.stream().allMatch(response -> response.is4xx || response.is5xx);
}

/**
* Check if there's at least one vendor extension
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
self,
{{#if bodyParam}}
{{#with bodyParam}}
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}{{#unless required}}schemas.Unset] = schemas.unset{{else}}]{{/unless}},
{{/with}}
{{#if bodyParam.required}}
{{#with bodyParam}}
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}},{{> model_templates/schema_python_types }}{{/with}}{{/each}}],
{{/with}}
{{#if isOverload}}
{{#eq skipDeserialization "True"}}
skip_deserialization: typing_extensions.Literal[True],
{{/eq}}
{{/if}}
{{else}}
{{#if isOverload}}
{{#eq skipDeserialization "True"}}
skip_deserialization: typing_extensions.Literal[True],
{{/eq}}
{{/if}}
{{#with bodyParam}}
body: typing.Union[{{#each content}}{{#with this.schema}}{{baseName}}, {{> model_templates/schema_python_types }}{{/with}}{{/each}}schemas.Unset] = schemas.unset,
{{/with}}
{{/if}}
{{/if}}
{{#if queryParams}}
query_params: RequestQueryParams = frozendict.frozendict(),
Expand Down Expand Up @@ -32,54 +48,47 @@
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
{{#if isOverload}}
{{#eq skipDeserialization "True"}}
skip_deserialization: typing_extensions.Literal[True] = True,
{{/eq}}
{{#eq skipDeserialization "False"}}
skip_deserialization: typing_extensions.Literal[False] = False,
skip_deserialization: typing_extensions.Literal[False] = ...,
{{/eq}}
{{#eq skipDeserialization "null"}}
skip_deserialization: bool = False,
skip_deserialization: bool = ...,
{{/eq}}
{{else}}
skip_deserialization: bool = False,
{{/if}}
{{#eq skipDeserialization "True"}}
) -> api_client.ApiResponseWithoutDeserialization:
) -> api_client.ApiResponseWithoutDeserialization: ...
{{/eq}}
{{#eq skipDeserialization "False"}}
) -> typing.Union[{{#each responses}}{{#if isDefault}}ApiResponseForDefault,{{else}}{{#if is2xx}}ApiResponseFor{{code}},{{/if}}{{/if}}{{/each}}api_client.ApiResponse]:
) -> {{#if getAllResponsesAreErrors}}api_client.ApiResponseWithoutDeserialization: ...{{else}}typing.Union[
{{#each responses}}
{{#if isDefault}}
ApiResponseForDefault,
{{else}}
{{#if is2xx}}
ApiResponseFor{{code}},
{{/if}}
{{/if}}
{{/each}}
]: ...
{{/if}}
{{/eq}}
{{#eq skipDeserialization "null"}}
{{#if isOverload}}
) -> typing.Union[
{{#each responses}}
{{#if isDefault}}
{{#each responses}}
{{#if isDefault}}
ApiResponseForDefault,
{{else}}
{{#if is2xx}}
{{else}}
{{#if is2xx}}
ApiResponseFor{{code}},
{{/if}}
{{/if}}
{{/each}}
{{/if}}
{{/each}}
api_client.ApiResponseWithoutDeserialization,
]:
]: ...
{{else}}
) -> typing.Union[
{{#each responses}}
{{#if isDefault}}
ApiResponseForDefault,
{{else}}
{{#if is2xx}}
ApiResponseFor{{code}},
{{/if}}
{{/if}}
{{/each}}
api_client.ApiResponse,
api_client.ApiResponseWithoutDeserialization,
]:
):
{{/if}}
{{/eq}}
{{#if isOverload}}
...
{{/if}}
{{/eq}}
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,8 @@ paths:
schema:
type: string
responses:
'400':
description: Invalid username supplied
'200':
description: Success
'404':
description: User not found
/fake_classname_test:
Expand Down Expand Up @@ -651,8 +651,8 @@ paths:
- 1.1
- -1.2
responses:
'400':
description: Invalid request
'200':
description: Success
'404':
description: Not found
requestBody:
Expand Down Expand Up @@ -693,8 +693,8 @@ paths:
가짜 엔드 포인트
operationId: EndpointParameters
responses:
'400':
description: Invalid username supplied
'200':
description: Success
'404':
description: User not found
security:
Expand Down Expand Up @@ -822,8 +822,8 @@ paths:
type: integer
format: int64
responses:
'400':
description: Someting wrong
'200':
description: succeeded
/fake/refs/number:
post:
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = False,
) -> typing.Union[ApiResponseFor200,api_client.ApiResponse]:
...
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> typing.Union[
ApiResponseFor200,
]: ...

@typing.overload
def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg(
self,
body: typing.Union[SchemaForRequestBodyApplicationJson,],
skip_deserialization: typing_extensions.Literal[True],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[True] = True,
) -> api_client.ApiResponseWithoutDeserialization:
...
) -> api_client.ApiResponseWithoutDeserialization: ...

@typing.overload
def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg(
Expand All @@ -88,12 +88,11 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
skip_deserialization: bool = ...,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization,
]:
...
]: ...

def _post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg(
self,
Expand All @@ -102,11 +101,7 @@ def _post_additionalproperties_allows_a_schema_which_should_validate_request_bod
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponse,
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
Expand Down Expand Up @@ -163,20 +158,20 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = False,
) -> typing.Union[ApiResponseFor200,api_client.ApiResponse]:
...
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> typing.Union[
ApiResponseFor200,
]: ...

@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
body: typing.Union[SchemaForRequestBodyApplicationJson,],
skip_deserialization: typing_extensions.Literal[True],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[True] = True,
) -> api_client.ApiResponseWithoutDeserialization:
...
) -> api_client.ApiResponseWithoutDeserialization: ...

@typing.overload
def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
Expand All @@ -185,12 +180,11 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
skip_deserialization: bool = ...,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization,
]:
...
]: ...

def post_additionalproperties_allows_a_schema_which_should_validate_request_body(
self,
Expand All @@ -199,11 +193,7 @@ def post_additionalproperties_allows_a_schema_which_should_validate_request_body
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponse,
api_client.ApiResponseWithoutDeserialization,
]:
):
return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg(
body=body,
content_type=content_type,
Expand All @@ -223,20 +213,20 @@ def post(
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[False] = False,
) -> typing.Union[ApiResponseFor200,api_client.ApiResponse]:
...
skip_deserialization: typing_extensions.Literal[False] = ...,
) -> typing.Union[
ApiResponseFor200,
]: ...

@typing.overload
def post(
self,
body: typing.Union[SchemaForRequestBodyApplicationJson,],
skip_deserialization: typing_extensions.Literal[True],
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: typing_extensions.Literal[True] = True,
) -> api_client.ApiResponseWithoutDeserialization:
...
) -> api_client.ApiResponseWithoutDeserialization: ...

@typing.overload
def post(
Expand All @@ -245,12 +235,11 @@ def post(
content_type: str = 'application/json',
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
skip_deserialization: bool = ...,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponseWithoutDeserialization,
]:
...
]: ...

def post(
self,
Expand All @@ -259,11 +248,7 @@ def post(
stream: bool = False,
timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
skip_deserialization: bool = False,
) -> typing.Union[
ApiResponseFor200,
api_client.ApiResponse,
api_client.ApiResponseWithoutDeserialization,
]:
):
return self._post_additionalproperties_allows_a_schema_which_should_validate_request_body_oapg(
body=body,
content_type=content_type,
Expand Down
Loading