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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,17 @@ SecuritySchemeInfo = typing_extensions.TypedDict(
total=False
)

"""
the default security_index to use at each openapi document json path
the fallback value is stored in the 'security' key
"""
SecurityIndexInfo = typing_extensions.TypedDict(
'SecurityIndexInfo',
{

class SecurityIndexInfoRequired(typing_extensions.TypedDict):
{{#if security}}
'security': typing_extensions.Literal[{{#each security}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}],
security: typing_extensions.Literal[{{#each security}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}]
{{else}}
'security': int,
security: int
{{/if}}

SecurityIndexInfoOptional = typing_extensions.TypedDict(
'SecurityIndexInfoOptional',
{
{{#each paths}}
{{#if operations}}
{{#each operations}}
Expand All @@ -81,6 +80,13 @@ SecurityIndexInfo = typing_extensions.TypedDict(
},
total=False
)


class SecurityIndexInfo(SecurityIndexInfoRequired, SecurityIndexInfoOptional):
"""
the default security_index to use at each openapi document json path
the fallback value is stored in the 'security' key
"""
{{/if}}
{{#if hasServers}}

Expand Down Expand Up @@ -111,18 +117,17 @@ ServerInfo = typing_extensions.TypedDict(
total=False
)

"""
the default server_index to use at each openapi document json path
the fallback value is stored in the 'servers' key
"""
ServerIndexInfo = typing_extensions.TypedDict(
'ServerIndexInfo',
{

class ServerIndexInfoRequired(typing_extensions.TypedDict):
{{#if servers}}
'servers': typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}],
servers: typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}]
{{else}}
'servers': int,
servers: int
{{/if}}

ServerIndexInfoOptional = typing_extensions.TypedDict(
'ServerIndexInfoOptional',
{
{{#each paths}}
{{#if servers}}
"paths/{{@key.original}}/servers": typing_extensions.Literal[{{#each servers}}{{#unless @first}}, {{/unless}}{{@key}}{{/each}}],
Expand All @@ -138,6 +143,13 @@ ServerIndexInfo = typing_extensions.TypedDict(
},
total=False
)


class ServerIndexInfo(ServerIndexInfoRequired, ServerIndexInfoOptional):
"""
the default server_index to use at each openapi document json path
the fallback value is stored in the 'servers' key
"""
{{/if}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,41 @@ from {{packageName}}.components.security_schemes import {{refInfo.refModule}}
{{/gt}}
{{/neq}}
{{/neq}}
{{#neq security null}}
{{#gt security.size 1}}
security_index_info: api_configuration.SecurityIndexInfo = {
"security": 0, # default value
{{#each security}}
{{#unless @first}}# only set one {{/unless}}"paths/{{path.original}}/{{httpMethod.original}}/security": {{@key}},
{{/each}}
}
{{/gt}}
{{else}}
{{#neq rootSecurity null}}
{{#gt rootSecurity.size 1}}
security_index_info: api_configuration.SecurityIndexInfo = {
{{#each rootSecurity}}
{{#unless @first}}# only set one {{/unless}}"security": {{@key}},
{{/each}}
}
{{/gt}}
{{/neq}}
{{/neq}}
used_configuration = api_configuration.ApiConfiguration(
{{#neq security null}}
{{#gt security.size 0}}
security_scheme_info=security_scheme_info
security_scheme_info=security_scheme_info,
{{/gt}}
{{#gt security.size 1}}
security_index_info=security_index_info
{{/gt}}
{{else}}
{{#neq rootSecurity null}}
{{#gt rootSecurity.size 0}}
security_scheme_info=security_scheme_info
security_scheme_info=security_scheme_info,
{{/gt}}
{{#gt rootSecurity.size 1}}
security_index_info=security_index_info
{{/gt}}
{{/neq}}
{{/neq}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@ content_type | str | optional, default is '{{@key.original}}' | Selects the sche
{{#if produces}}
accept_content_types | typing.Tuple[str] | default is ({{#each produces}}"{{{.}}}", {{/each}}) | Tells the server the content type(s) that are accepted by the client
{{/if}}
server_index | typing.Optional[int] | default is None | Allows one to select a different server
{{#neq security null}}
{{#gt security.size 0}}
security_index | typing.Optional[int] | default is None | Allows one to select a different [security](#security) definition. If not None, must be one of [{{#each security}}{{@key}}{{#unless @last}}, {{/unless}}{{/each}}]
{{/gt}}
{{else}}
{{#neq ../security null}}
{{#gt ../security.size 0}}
security_index | typing.Optional[int] | default is None | Allows one to select a different [security](#security) definition. If not None, must be one of [{{#each ../security}}{{@key}}{{#unless @last}}, {{/unless}}{{/each}}]
{{/gt}}
{{/neq}}
{{/neq}}
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers){{#if servers}}. If not None, must be one of [{{#each servers}}{{@key}}{{#unless @last}}, {{/unless}}{{/each}}]{{else}}{{#if pathItem.servers}}. If not None, must be one of [{{#each pathItem.servers}}{{@key}}{{#unless @last}}, {{/unless}}{{/each}}]{{else}}. If not None, must be one of [{{#each ../servers}}{{@key}}{{#unless @last}}, {{/unless}}{{/each}}]{{/if}}{{/if}}
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -222,7 +233,7 @@ server_index | Class | Description
{{/each}}
{{else}}
{{#each ../servers}}
{{@key}} | [{{jsonPathPiece.camelCase}}](../../../servers/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}}
{{@key}} | [{{jsonPathPiece.camelCase}}](../../servers/{{jsonPathPiece.snakeCase}}.md) |{{#if description}} {{description}}{{/if}}
{{/each}}
{{/if}}
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
[body](#requestbody) | typing.Union[[RequestBody.content.application_json.schema](#RequestBody-content-applicationjson-schema), dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader] | required |
content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body
server_index | typing.Optional[int] | default is None | Allows one to select a different server
server_index | typing.Optional[int] | default is None | Allows one to select a different [server](#servers). If not None, must be one of [0]
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Expand Down Expand Up @@ -77,7 +77,7 @@ passing server_index in to the endpoint method.

server_index | Class | Description
------------ | ----- | ------------
0 | [Server0](../../../servers/server_0.md) |
0 | [Server0](../../servers/server_0.md) |

## Code Sample

Expand Down
Loading