forked from loafle/openapi-generator-original
[python-experimental] reduces python version (#13481)
* Removes classmethod property combinations * Changes python version to 3.8 * Changes python version to 3.7 * Tests fixed * Samples updated * Adds getAddSuffixToDuplicateOperationNickname and uses it in python-exp, samples regenerated * test_paths regenerated * Fixes bug * Adds typing_extensions requirement
This commit is contained in:
parent
fa51d8b6b3
commit
5f9910dcab
@ -10,7 +10,7 @@ title: Documentation for the python-experimental Generator
|
||||
| generator stability | EXPERIMENTAL | |
|
||||
| generator type | CLIENT | |
|
||||
| generator language | Python | |
|
||||
| generator language version | >=3.9 | |
|
||||
| generator language version | >=3.7 | |
|
||||
| generator default templating engine | handlebars | |
|
||||
| helpTxt | Generates a Python client library<br /><br />Features in this generator:<br />- type hints on endpoints and model creation<br />- model parameter names use the spec defined keys and cases<br />- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only<br />- endpoint parameter names use the spec defined keys and cases<br />- inline schemas are supported at any location including composition<br />- multiple content types supported in request body and response bodies<br />- run time type checking<br />- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema<br />- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema<br />- quicker load time for python modules (a single endpoint can be imported and used without loading others)<br />- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed<br />- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)<br />- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor<br /> - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | |
|
||||
|
||||
|
@ -328,4 +328,6 @@ public interface CodegenConfig {
|
||||
List<VendorExtension> getSupportedVendorExtensions();
|
||||
|
||||
boolean getUseInlineModelResolver();
|
||||
|
||||
boolean getAddSuffixToDuplicateOperationNicknames();
|
||||
}
|
||||
|
@ -297,6 +297,12 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// from deeper schema defined locations
|
||||
protected boolean addSchemaImportsFromV3SpecLocations = false;
|
||||
|
||||
protected boolean addSuffixToDuplicateOperationNicknames = true;
|
||||
|
||||
public boolean getAddSuffixToDuplicateOperationNicknames() {
|
||||
return addSuffixToDuplicateOperationNicknames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CliOption> cliOptions() {
|
||||
return cliOptions;
|
||||
|
@ -1200,7 +1200,8 @@ public class DefaultGenerator implements Generator {
|
||||
objs.setClassname(config.toApiName(tag));
|
||||
objs.setPathPrefix(config.toApiVarName(tag));
|
||||
|
||||
// check for operationId uniqueness
|
||||
// check for nickname uniqueness
|
||||
if (config.getAddSuffixToDuplicateOperationNicknames()) {
|
||||
Set<String> opIds = new HashSet<>();
|
||||
int counter = 0;
|
||||
for (CodegenOperation op : ops) {
|
||||
@ -1211,6 +1212,7 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
opIds.add(opId);
|
||||
}
|
||||
}
|
||||
objs.setOperation(ops);
|
||||
|
||||
operations.setOperation(objs);
|
||||
|
@ -20,7 +20,6 @@ import com.github.curiousoddman.rgxgen.RgxGen;
|
||||
import com.github.curiousoddman.rgxgen.config.RgxGenOption;
|
||||
import com.github.curiousoddman.rgxgen.config.RgxGenProperties;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import io.swagger.v3.oas.annotations.tags.Tags;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.PathItem;
|
||||
@ -112,6 +111,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
||||
addSchemaImportsFromV3SpecLocations = true;
|
||||
sortModelPropertiesByRequiredFlag = Boolean.TRUE;
|
||||
sortParamsByRequiredFlag = Boolean.TRUE;
|
||||
addSuffixToDuplicateOperationNicknames = false;
|
||||
|
||||
modifyFeatureSet(features -> features
|
||||
.includeSchemaSupportFeatures(
|
||||
@ -2638,7 +2638,7 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generatorLanguageVersion() { return ">=3.9"; };
|
||||
public String generatorLanguageVersion() { return ">=3.7"; };
|
||||
|
||||
@Override
|
||||
public void preprocessOpenAPI(OpenAPI openAPI) {
|
||||
|
@ -18,8 +18,6 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
||||
## Requirements.
|
||||
|
||||
Python {{generatorLanguageVersion}}
|
||||
v3.9 is needed so one can combine classmethod and property decorators to define
|
||||
object schema properties as classes
|
||||
|
||||
## Migration from other generators like python and python-legacy
|
||||
|
||||
@ -60,6 +58,16 @@ object schema properties as classes
|
||||
- A type hint is also generated for additionalProperties accessed using this method
|
||||
- So you will need to update you code to use some_instance['optionalProp'] to access optional property
|
||||
and additionalProperty values
|
||||
8. The location of the api classes has changed
|
||||
- Api classes are located in your_package.apis.tags.some_api
|
||||
- This change was made to eliminate redundant code generation
|
||||
- Legacy generators generated the same endpoint twice if it had > 1 tag on it
|
||||
- This generator defines an endpoint in one class, then inherits that class to generate
|
||||
apis by tags and by paths
|
||||
- This change reduces code and allows quicker run time if you use the path apis
|
||||
- path apis are at your_package.apis.paths.some_path
|
||||
- Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api
|
||||
- So you will need to update your import paths to the api classes
|
||||
|
||||
### Why are Oapg and _oapg used in class and method names?
|
||||
Classes can have arbitrarily named properties set on them
|
||||
|
@ -41,7 +41,7 @@ class ApiTestMixin:
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def headers_for_content_type(content_type: str) -> dict[str, str]:
|
||||
def headers_for_content_type(content_type: str) -> typing.Dict[str, str]:
|
||||
return {'content-type': content_type}
|
||||
|
||||
@classmethod
|
||||
@ -50,7 +50,7 @@ class ApiTestMixin:
|
||||
body: typing.Union[str, bytes],
|
||||
status: int = 200,
|
||||
content_type: str = json_content_type,
|
||||
headers: typing.Optional[dict[str, str]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||
preload_content: bool = True
|
||||
) -> urllib3.HTTPResponse:
|
||||
if headers is None:
|
||||
|
@ -13,6 +13,7 @@ from multiprocessing.pool import ThreadPool
|
||||
import re
|
||||
import tempfile
|
||||
import typing
|
||||
import typing_extensions
|
||||
import urllib3
|
||||
from urllib3._collections import HTTPHeaderDict
|
||||
from urllib.parse import urlparse, quote
|
||||
@ -704,7 +705,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict[str, str]:
|
||||
def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict:
|
||||
data = tuple(t for t in in_data if t)
|
||||
headers = HTTPHeaderDict()
|
||||
if not data:
|
||||
@ -716,7 +717,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer):
|
||||
self,
|
||||
in_data: typing.Union[
|
||||
Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict]
|
||||
) -> HTTPHeaderDict[str, str]:
|
||||
) -> HTTPHeaderDict:
|
||||
if self.schema:
|
||||
cast_in_data = self.schema(in_data)
|
||||
cast_in_data = self._json_encoder.default(cast_in_data)
|
||||
@ -1270,7 +1271,7 @@ class Api:
|
||||
self.api_client = api_client
|
||||
|
||||
@staticmethod
|
||||
def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing.TypedDict], data: typing.Dict[str, typing.Any]):
|
||||
def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]):
|
||||
"""
|
||||
Ensures that:
|
||||
- required keys are present
|
||||
@ -1342,9 +1343,9 @@ class Api:
|
||||
return host
|
||||
|
||||
|
||||
class SerializedRequestBody(typing.TypedDict, total=False):
|
||||
class SerializedRequestBody(typing_extensions.TypedDict, total=False):
|
||||
body: typing.Union[str, bytes]
|
||||
fields: typing.Tuple[typing.Union[RequestField, tuple[str, str]], ...]
|
||||
fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...]
|
||||
|
||||
|
||||
class RequestBody(StyleFormSerializer, JSONDetector):
|
||||
|
@ -1,11 +1,11 @@
|
||||
import typing
|
||||
import typing_extensions
|
||||
|
||||
from {{packageName}}.paths import PathValues
|
||||
{{#each pathModuleToApiClassname}}
|
||||
from {{packageName}}.apis.paths.{{@key}} import {{this}}
|
||||
{{/each}}
|
||||
|
||||
PathToApi = typing.TypedDict(
|
||||
PathToApi = typing_extensions.TypedDict(
|
||||
'PathToApi',
|
||||
{
|
||||
{{#each pathEnumToApiClassname}}
|
||||
|
@ -1,11 +1,11 @@
|
||||
import typing
|
||||
import typing_extensions
|
||||
|
||||
from {{packageName}}.apis.tags import TagValues
|
||||
{{#each tagModuleNameToApiClassname}}
|
||||
from {{packageName}}.apis.tags.{{@key}} import {{this}}
|
||||
{{/each}}
|
||||
|
||||
TagToApi = typing.TypedDict(
|
||||
TagToApi = typing_extensions.TypedDict(
|
||||
'TagToApi',
|
||||
{
|
||||
{{#each tagEnumToApiClassname}}
|
||||
|
@ -3,6 +3,7 @@
|
||||
{{>partial_header}}
|
||||
|
||||
from dataclasses import dataclass
|
||||
import typing_extensions
|
||||
import urllib3
|
||||
{{#with operation}}
|
||||
{{#or headerParams bodyParam produces}}
|
||||
@ -27,7 +28,7 @@ from . import path
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
{{#unless isStub}}
|
||||
RequestRequiredQueryParams = typing.TypedDict(
|
||||
RequestRequiredQueryParams = typing_extensions.TypedDict(
|
||||
'RequestRequiredQueryParams',
|
||||
{
|
||||
{{#each queryParams}}
|
||||
@ -37,7 +38,7 @@ RequestRequiredQueryParams = typing.TypedDict(
|
||||
{{/each}}
|
||||
}
|
||||
)
|
||||
RequestOptionalQueryParams = typing.TypedDict(
|
||||
RequestOptionalQueryParams = typing_extensions.TypedDict(
|
||||
'RequestOptionalQueryParams',
|
||||
{
|
||||
{{#each queryParams}}
|
||||
@ -67,7 +68,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams)
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
{{#unless isStub}}
|
||||
RequestRequiredHeaderParams = typing.TypedDict(
|
||||
RequestRequiredHeaderParams = typing_extensions.TypedDict(
|
||||
'RequestRequiredHeaderParams',
|
||||
{
|
||||
{{#each headerParams}}
|
||||
@ -77,7 +78,7 @@ RequestRequiredHeaderParams = typing.TypedDict(
|
||||
{{/each}}
|
||||
}
|
||||
)
|
||||
RequestOptionalHeaderParams = typing.TypedDict(
|
||||
RequestOptionalHeaderParams = typing_extensions.TypedDict(
|
||||
'RequestOptionalHeaderParams',
|
||||
{
|
||||
{{#each headerParams}}
|
||||
@ -107,7 +108,7 @@ class RequestHeaderParams(RequestRequiredHeaderParams, RequestOptionalHeaderPara
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
{{#unless isStub}}
|
||||
RequestRequiredPathParams = typing.TypedDict(
|
||||
RequestRequiredPathParams = typing_extensions.TypedDict(
|
||||
'RequestRequiredPathParams',
|
||||
{
|
||||
{{#each pathParams}}
|
||||
@ -117,7 +118,7 @@ RequestRequiredPathParams = typing.TypedDict(
|
||||
{{/each}}
|
||||
}
|
||||
)
|
||||
RequestOptionalPathParams = typing.TypedDict(
|
||||
RequestOptionalPathParams = typing_extensions.TypedDict(
|
||||
'RequestOptionalPathParams',
|
||||
{
|
||||
{{#each pathParams}}
|
||||
@ -147,7 +148,7 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams):
|
||||
{{/with}}
|
||||
{{/each}}
|
||||
{{#unless isStub}}
|
||||
RequestRequiredCookieParams = typing.TypedDict(
|
||||
RequestRequiredCookieParams = typing_extensions.TypedDict(
|
||||
'RequestRequiredCookieParams',
|
||||
{
|
||||
{{#each cookieParams}}
|
||||
@ -157,7 +158,7 @@ RequestRequiredCookieParams = typing.TypedDict(
|
||||
{{/each}}
|
||||
}
|
||||
)
|
||||
RequestOptionalCookieParams = typing.TypedDict(
|
||||
RequestOptionalCookieParams = typing_extensions.TypedDict(
|
||||
'RequestOptionalCookieParams',
|
||||
{
|
||||
{{#each cookieParams}}
|
||||
@ -278,7 +279,7 @@ _servers = (
|
||||
{{/each}}
|
||||
{{#unless isStub}}
|
||||
{{#if responseHeaders}}
|
||||
ResponseHeadersFor{{code}} = typing.TypedDict(
|
||||
ResponseHeadersFor{{code}} = typing_extensions.TypedDict(
|
||||
'ResponseHeadersFor{{code}}',
|
||||
{
|
||||
{{#each responseHeaders}}
|
||||
|
@ -19,8 +19,7 @@
|
||||
{{#if allOf}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -46,8 +45,7 @@ def all_of(cls):
|
||||
{{#if oneOf}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def one_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -73,8 +71,7 @@ def one_of(cls):
|
||||
{{#if anyOf}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -101,9 +98,8 @@ def any_of(cls):
|
||||
{{#with not}}
|
||||
{{#if complexType}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def {{baseName}}(cls) -> typing.Type['{{complexType}}']:
|
||||
@staticmethod
|
||||
def {{baseName}}() -> typing.Type['{{complexType}}']:
|
||||
return {{complexType}}
|
||||
{{else}}
|
||||
{{> model_templates/schema }}
|
||||
|
@ -10,9 +10,8 @@ required = {
|
||||
{{#each mappedModels}}
|
||||
{{#if @first}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def discriminator(cls):
|
||||
@staticmethod
|
||||
def discriminator():
|
||||
return {
|
||||
'{{{propertyBaseName}}}': {
|
||||
{{/if}}
|
||||
@ -30,9 +29,8 @@ class properties:
|
||||
{{#each vars}}
|
||||
{{#if complexType}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def {{baseName}}(cls) -> typing.Type['{{complexType}}']:
|
||||
@staticmethod
|
||||
def {{baseName}}() -> typing.Type['{{complexType}}']:
|
||||
return {{complexType}}
|
||||
{{else}}
|
||||
{{> model_templates/schema }}
|
||||
@ -51,9 +49,8 @@ class properties:
|
||||
{{#with additionalProperties}}
|
||||
{{#if complexType}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def {{baseName}}(cls) -> typing.Type['{{complexType}}']:
|
||||
@staticmethod
|
||||
def {{baseName}}() -> typing.Type['{{complexType}}']:
|
||||
return {{complexType}}
|
||||
{{else}}
|
||||
{{> model_templates/schema }}
|
||||
|
@ -1,15 +1,13 @@
|
||||
{{#if isNull}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def NONE(cls):
|
||||
return cls(None)
|
||||
{{/if}}
|
||||
{{#with allowableValues}}
|
||||
{{#each enumVars}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def {{name}}(cls):
|
||||
return cls({{{value}}})
|
||||
{{/each}}
|
||||
|
@ -4,6 +4,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -1,9 +1,8 @@
|
||||
{{#with items}}
|
||||
{{#if complexType}}
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
def {{baseName}}(cls) -> typing.Type['{{complexType}}']:
|
||||
@staticmethod
|
||||
def {{baseName}}() -> typing.Type['{{complexType}}']:
|
||||
return {{complexType}}
|
||||
{{else}}
|
||||
{{> model_templates/schema }}
|
||||
|
@ -4,15 +4,15 @@
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
{{else}}
|
||||
{{#if schemaIsFromAdditionalProperties}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
{{else}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@ -25,12 +25,12 @@ def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.proper
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
{{else}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
@ -58,15 +58,15 @@ def __getitem__(self, name: str) -> {{#if complexType}}'{{complexType}}'{{else}}
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
{{else}}
|
||||
{{#if schemaIsFromAdditionalProperties}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.additional_properties: ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
{{else}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
@ -79,12 +79,12 @@ def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.prop
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> typing.Union['{{complexType}}', schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union['{{complexType}}', schemas.Unset]: ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{name}}, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{name}}, schemas.Unset]: ...
|
||||
{{else}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{baseName}}, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> typing.Union[MetaOapg.properties.{{baseName}}, schemas.Unset]: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
def {{methodName}}(self, name: typing.Union[{{#each getRequiredVarsMap}}{{#with this}}typing.Literal["{{{baseName}}}"], {{/with}}{{/each}}{{#each vars}}{{#unless required}}typing.Literal["{{{baseName}}}"], {{/unless}}{{/each}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}}str, {{/unless}}{{/with}}]){{#not vars}}{{#not getRequiredVarsMap}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}} -> {{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}{{/unless}}{{/with}}{{/not}}{{/not}}:
|
||||
def {{methodName}}(self, name: typing.Union[{{#each getRequiredVarsMap}}{{#with this}}typing_extensions.Literal["{{{baseName}}}"], {{/with}}{{/each}}{{#each vars}}{{#unless required}}typing_extensions.Literal["{{{baseName}}}"], {{/unless}}{{/each}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}}str, {{/unless}}{{/with}}]){{#not vars}}{{#not getRequiredVarsMap}}{{#with additionalProperties}}{{#unless getIsBooleanSchemaFalse}} -> {{#if complexType}}'{{complexType}}'{{else}}MetaOapg.{{baseName}}{{/if}}{{/unless}}{{/with}}{{/not}}{{/not}}:
|
||||
{{#eq methodName "__getitem__"}}
|
||||
# dict_instance[name] accessor
|
||||
{{/eq}}
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> '{{complexType}}': ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{name}}: ...
|
||||
{{else}}
|
||||
def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> MetaOapg.properties.{{baseName}}: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
@ -16,7 +16,7 @@ def __getitem__(self, name: typing.Literal["{{{baseName}}}"]) -> MetaOapg.proper
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
@ -26,12 +26,12 @@ def __getitem__(self, name: typing.Union[typing.Literal[{{#each vars}}"{{{baseNa
|
||||
|
||||
@typing.overload
|
||||
{{#if complexType}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}'{{complexType}}'{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}'{{complexType}}'{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
{{else}}
|
||||
{{#if nameInSnakeCase}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{name}}{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{name}}{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
{{else}}
|
||||
def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{baseName}}{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["{{{baseName}}}"]) -> {{#unless required}}typing.Union[{{/unless}}MetaOapg.properties.{{baseName}}{{#unless required}}, schemas.Unset]{{/unless}}: ...
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
@ -39,7 +39,7 @@ def get_item_oapg(self, name: typing.Literal["{{{baseName}}}"]) -> {{#unless req
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal[{{#each vars}}"{{{baseName}}}", {{/each}}], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
{{/if}}
|
@ -8,6 +8,7 @@ import functools
|
||||
import decimal
|
||||
import io
|
||||
import re
|
||||
import types
|
||||
import typing
|
||||
import uuid
|
||||
|
||||
@ -176,9 +177,17 @@ class Singleton:
|
||||
return f'<{self.__class__.__name__}: {super().__repr__()}>'
|
||||
|
||||
|
||||
class classproperty:
|
||||
|
||||
def __init__(self, fget):
|
||||
self.fget = fget
|
||||
|
||||
def __get__(self, owner_self, owner_cls):
|
||||
return self.fget(owner_cls)
|
||||
|
||||
|
||||
class NoneClass(Singleton):
|
||||
@classmethod
|
||||
@property
|
||||
@classproperty
|
||||
def NONE(cls):
|
||||
return cls(None)
|
||||
|
||||
@ -187,17 +196,15 @@ class NoneClass(Singleton):
|
||||
|
||||
|
||||
class BoolClass(Singleton):
|
||||
@classmethod
|
||||
@property
|
||||
@classproperty
|
||||
def TRUE(cls):
|
||||
return cls(True)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@classproperty
|
||||
def FALSE(cls):
|
||||
return cls(False)
|
||||
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def __bool__(self) -> bool:
|
||||
for key, instance in self._instances.items():
|
||||
if self is instance:
|
||||
@ -249,6 +256,16 @@ class Schema:
|
||||
return "is {0}".format(all_class_names[0])
|
||||
return "is one of [{0}]".format(", ".join(all_class_names))
|
||||
|
||||
@staticmethod
|
||||
def _get_class_oapg(item_cls: typing.Union[types.FunctionType, staticmethod, typing.Type['Schema']]) -> typing.Type['Schema']:
|
||||
if isinstance(item_cls, types.FunctionType):
|
||||
# referenced schema
|
||||
return item_cls()
|
||||
elif isinstance(item_cls, staticmethod):
|
||||
# referenced schema
|
||||
return item_cls.__func__()
|
||||
return item_cls
|
||||
|
||||
@classmethod
|
||||
def __type_error_message(
|
||||
cls, var_value=None, var_name=None, valid_classes=None, key_type=None
|
||||
@ -856,39 +873,19 @@ class ValidatorBase:
|
||||
)
|
||||
|
||||
|
||||
class Validator(typing.Protocol):
|
||||
@classmethod
|
||||
def _validate_oapg(
|
||||
cls,
|
||||
arg,
|
||||
validation_metadata: ValidationMetadata,
|
||||
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
||||
pass
|
||||
|
||||
|
||||
class EnumMakerBase:
|
||||
pass
|
||||
|
||||
|
||||
class EnumMakerInterface(Validator):
|
||||
@classmethod
|
||||
@property
|
||||
def _enum_value_to_name(
|
||||
cls
|
||||
) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]:
|
||||
pass
|
||||
|
||||
|
||||
def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> EnumMakerInterface:
|
||||
def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> 'SchemaEnumMaker':
|
||||
class SchemaEnumMaker(EnumMakerBase):
|
||||
@classmethod
|
||||
@property
|
||||
def _enum_value_to_name(
|
||||
cls
|
||||
) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]:
|
||||
pass
|
||||
try:
|
||||
super_enum_value_to_name = super()._enum_value_to_name
|
||||
super_enum_value_to_name = super()._enum_value_to_name()
|
||||
except AttributeError:
|
||||
return enum_value_to_name
|
||||
intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items())
|
||||
@ -905,9 +902,9 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str,
|
||||
Validates that arg is in the enum's allowed values
|
||||
"""
|
||||
try:
|
||||
cls._enum_value_to_name[arg]
|
||||
cls._enum_value_to_name()[arg]
|
||||
except KeyError:
|
||||
raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name))
|
||||
raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name()))
|
||||
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
||||
|
||||
return SchemaEnumMaker
|
||||
@ -1034,7 +1031,7 @@ class StrBase(ValidatorBase):
|
||||
|
||||
class UUIDBase:
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def as_uuid_oapg(self) -> uuid.UUID:
|
||||
return uuid.UUID(self)
|
||||
|
||||
@ -1100,7 +1097,7 @@ DEFAULT_ISOPARSER = CustomIsoparser()
|
||||
|
||||
class DateBase:
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def as_date_oapg(self) -> date:
|
||||
return DEFAULT_ISOPARSER.parse_isodate(self)
|
||||
|
||||
@ -1131,7 +1128,7 @@ class DateBase:
|
||||
|
||||
class DateTimeBase:
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def as_datetime_oapg(self) -> datetime:
|
||||
return DEFAULT_ISOPARSER.parse_isodatetime(self)
|
||||
|
||||
@ -1168,7 +1165,7 @@ class DecimalBase:
|
||||
"""
|
||||
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def as_decimal_oapg(self) -> decimal.Decimal:
|
||||
return decimal.Decimal(self)
|
||||
|
||||
@ -1337,6 +1334,7 @@ class ListBase(ValidatorBase):
|
||||
# if we have definitions for an items schema, use it
|
||||
# otherwise accept anything
|
||||
item_cls = getattr(cls.MetaOapg, 'items', UnsetAnyTypeSchema)
|
||||
item_cls = cls._get_class_oapg(item_cls)
|
||||
path_to_schemas = {}
|
||||
for i, value in enumerate(list_items):
|
||||
item_validation_metadata = ValidationMetadata(
|
||||
@ -1470,7 +1468,7 @@ class Discriminable:
|
||||
"""
|
||||
if not hasattr(cls.MetaOapg, 'discriminator'):
|
||||
return None
|
||||
disc = cls.MetaOapg.discriminator
|
||||
disc = cls.MetaOapg.discriminator()
|
||||
if disc_property_name not in disc:
|
||||
return None
|
||||
discriminated_cls = disc[disc_property_name].get(disc_payload_value)
|
||||
@ -1485,17 +1483,20 @@ class Discriminable:
|
||||
):
|
||||
return None
|
||||
# TODO stop traveling if a cycle is hit
|
||||
for allof_cls in getattr(cls.MetaOapg, 'all_of', []):
|
||||
if hasattr(cls.MetaOapg, 'all_of'):
|
||||
for allof_cls in cls.MetaOapg.all_of():
|
||||
discriminated_cls = allof_cls.get_discriminated_class_oapg(
|
||||
disc_property_name=disc_property_name, disc_payload_value=disc_payload_value)
|
||||
if discriminated_cls is not None:
|
||||
return discriminated_cls
|
||||
for oneof_cls in getattr(cls.MetaOapg, 'one_of', []):
|
||||
if hasattr(cls.MetaOapg, 'one_of'):
|
||||
for oneof_cls in cls.MetaOapg.one_of():
|
||||
discriminated_cls = oneof_cls.get_discriminated_class_oapg(
|
||||
disc_property_name=disc_property_name, disc_payload_value=disc_payload_value)
|
||||
if discriminated_cls is not None:
|
||||
return discriminated_cls
|
||||
for anyof_cls in getattr(cls.MetaOapg, 'any_of', []):
|
||||
if hasattr(cls.MetaOapg, 'any_of'):
|
||||
for anyof_cls in cls.MetaOapg.any_of():
|
||||
discriminated_cls = anyof_cls.get_discriminated_class_oapg(
|
||||
disc_property_name=disc_property_name, disc_payload_value=disc_payload_value)
|
||||
if discriminated_cls is not None:
|
||||
@ -1598,9 +1599,7 @@ class DictBase(Discriminable, ValidatorBase):
|
||||
raise ApiTypeError('Unable to find schema for value={} in class={} at path_to_item={}'.format(
|
||||
value, cls, validation_metadata.path_to_item+(property_name,)
|
||||
))
|
||||
if isinstance(schema, classmethod):
|
||||
# referenced schema, call classmethod property
|
||||
schema = schema.__func__.fget(properties)
|
||||
schema = cls._get_class_oapg(schema)
|
||||
arg_validation_metadata = ValidationMetadata(
|
||||
from_server=validation_metadata.from_server,
|
||||
configuration=validation_metadata.configuration,
|
||||
@ -1671,7 +1670,7 @@ class DictBase(Discriminable, ValidatorBase):
|
||||
other_path_to_schemas = cls.__validate_args(arg, validation_metadata=validation_metadata)
|
||||
update(_path_to_schemas, other_path_to_schemas)
|
||||
try:
|
||||
discriminator = cls.MetaOapg.discriminator
|
||||
discriminator = cls.MetaOapg.discriminator()
|
||||
except AttributeError:
|
||||
return _path_to_schemas
|
||||
# discriminator exists
|
||||
@ -1856,7 +1855,7 @@ class ComposedBase(Discriminable):
|
||||
@classmethod
|
||||
def __get_allof_classes(cls, arg, validation_metadata: ValidationMetadata):
|
||||
path_to_schemas = defaultdict(set)
|
||||
for allof_cls in cls.MetaOapg.all_of:
|
||||
for allof_cls in cls.MetaOapg.all_of():
|
||||
if validation_metadata.validation_ran_earlier(allof_cls):
|
||||
continue
|
||||
other_path_to_schemas = allof_cls._validate_oapg(arg, validation_metadata=validation_metadata)
|
||||
@ -1872,7 +1871,7 @@ class ComposedBase(Discriminable):
|
||||
):
|
||||
oneof_classes = []
|
||||
path_to_schemas = defaultdict(set)
|
||||
for oneof_cls in cls.MetaOapg.one_of:
|
||||
for oneof_cls in cls.MetaOapg.one_of():
|
||||
if oneof_cls in path_to_schemas[validation_metadata.path_to_item]:
|
||||
oneof_classes.append(oneof_cls)
|
||||
continue
|
||||
@ -1907,7 +1906,7 @@ class ComposedBase(Discriminable):
|
||||
):
|
||||
anyof_classes = []
|
||||
path_to_schemas = defaultdict(set)
|
||||
for anyof_cls in cls.MetaOapg.any_of:
|
||||
for anyof_cls in cls.MetaOapg.any_of():
|
||||
if validation_metadata.validation_ran_earlier(anyof_cls):
|
||||
anyof_classes.append(anyof_cls)
|
||||
continue
|
||||
@ -1997,8 +1996,9 @@ class ComposedBase(Discriminable):
|
||||
)
|
||||
update(path_to_schemas, other_path_to_schemas)
|
||||
not_cls = None
|
||||
if hasattr(cls, 'MetaOapg'):
|
||||
not_cls = getattr(cls.MetaOapg, 'not_schema', None)
|
||||
if hasattr(cls, 'MetaOapg') and hasattr(cls.MetaOapg, 'not_schema'):
|
||||
not_cls = cls.MetaOapg.not_schema
|
||||
not_cls = cls._get_class_oapg(not_cls)
|
||||
if not_cls:
|
||||
other_path_to_schemas = None
|
||||
not_exception = ApiValueError(
|
||||
@ -2367,7 +2367,9 @@ class BinarySchema(
|
||||
BinaryMixin
|
||||
):
|
||||
class MetaOapg:
|
||||
one_of = [
|
||||
@staticmethod
|
||||
def one_of():
|
||||
return [
|
||||
BytesSchema,
|
||||
FileSchema,
|
||||
]
|
||||
@ -2449,7 +2451,7 @@ class DictSchema(
|
||||
schema_type_classes = {NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}
|
||||
|
||||
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def get_new_class(
|
||||
class_name: str,
|
||||
bases: typing.Tuple[typing.Type[typing.Union[Schema, typing.Any]], ...]
|
||||
|
@ -29,6 +29,7 @@ REQUIRES = [
|
||||
"pem>=19.3.0",
|
||||
"pycryptodome>=3.9.0",
|
||||
{{/if}}
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
setup(
|
||||
|
@ -1,7 +1,8 @@
|
||||
[tox]
|
||||
envlist = py39
|
||||
envlist = py37
|
||||
|
||||
[testenv]
|
||||
passenv = PYTHON_VERSION
|
||||
deps=-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
|
@ -9,9 +9,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
|
||||
|
||||
## Requirements.
|
||||
|
||||
Python >=3.9
|
||||
v3.9 is needed so one can combine classmethod and property decorators to define
|
||||
object schema properties as classes
|
||||
Python >=3.7
|
||||
|
||||
## Migration from other generators like python and python-legacy
|
||||
|
||||
@ -52,6 +50,16 @@ object schema properties as classes
|
||||
- A type hint is also generated for additionalProperties accessed using this method
|
||||
- So you will need to update you code to use some_instance['optionalProp'] to access optional property
|
||||
and additionalProperty values
|
||||
8. The location of the api classes has changed
|
||||
- Api classes are located in your_package.apis.tags.some_api
|
||||
- This change was made to eliminate redundant code generation
|
||||
- Legacy generators generated the same endpoint twice if it had > 1 tag on it
|
||||
- This generator defines an endpoint in one class, then inherits that class to generate
|
||||
apis by tags and by paths
|
||||
- This change reduces code and allows quicker run time if you use the path apis
|
||||
- path apis are at your_package.apis.paths.some_path
|
||||
- Those apis will only load their needed models, which is less to load than all of the resources needed in a tag api
|
||||
- So you will need to update your import paths to the api classes
|
||||
|
||||
### Why are Oapg and _oapg used in class and method names?
|
||||
Classes can have arbitrarily named properties set on them
|
||||
|
@ -25,6 +25,7 @@ REQUIRES = [
|
||||
"certifi",
|
||||
"python-dateutil",
|
||||
"frozendict >= 2.0.3",
|
||||
"typing_extensions",
|
||||
]
|
||||
|
||||
setup(
|
||||
@ -35,7 +36,7 @@ setup(
|
||||
author_email="team@openapitools.org",
|
||||
url="",
|
||||
keywords=["OpenAPI", "OpenAPI-Generator", "openapi 3.0.3 sample spec"],
|
||||
python_requires=">=3.9",
|
||||
python_requires=">=3.7",
|
||||
install_requires=REQUIRES,
|
||||
packages=find_packages(exclude=["test", "tests"]),
|
||||
include_package_data=True,
|
||||
|
@ -41,7 +41,7 @@ class ApiTestMixin:
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def headers_for_content_type(content_type: str) -> dict[str, str]:
|
||||
def headers_for_content_type(content_type: str) -> typing.Dict[str, str]:
|
||||
return {'content-type': content_type}
|
||||
|
||||
@classmethod
|
||||
@ -50,7 +50,7 @@ class ApiTestMixin:
|
||||
body: typing.Union[str, bytes],
|
||||
status: int = 200,
|
||||
content_type: str = json_content_type,
|
||||
headers: typing.Optional[dict[str, str]] = None,
|
||||
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||
preload_content: bool = True
|
||||
) -> urllib3.HTTPResponse:
|
||||
if headers is None:
|
||||
|
@ -1,7 +1,8 @@
|
||||
[tox]
|
||||
envlist = py39
|
||||
envlist = py37
|
||||
|
||||
[testenv]
|
||||
passenv = PYTHON_VERSION
|
||||
deps=-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
|
@ -20,6 +20,7 @@ from multiprocessing.pool import ThreadPool
|
||||
import re
|
||||
import tempfile
|
||||
import typing
|
||||
import typing_extensions
|
||||
import urllib3
|
||||
from urllib3._collections import HTTPHeaderDict
|
||||
from urllib.parse import urlparse, quote
|
||||
@ -708,7 +709,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer):
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict[str, str]:
|
||||
def __to_headers(in_data: typing.Tuple[typing.Tuple[str, str], ...]) -> HTTPHeaderDict:
|
||||
data = tuple(t for t in in_data if t)
|
||||
headers = HTTPHeaderDict()
|
||||
if not data:
|
||||
@ -720,7 +721,7 @@ class HeaderParameter(ParameterBase, StyleSimpleSerializer):
|
||||
self,
|
||||
in_data: typing.Union[
|
||||
Schema, Decimal, int, float, str, date, datetime, None, bool, list, tuple, dict, frozendict.frozendict]
|
||||
) -> HTTPHeaderDict[str, str]:
|
||||
) -> HTTPHeaderDict:
|
||||
if self.schema:
|
||||
cast_in_data = self.schema(in_data)
|
||||
cast_in_data = self._json_encoder.default(cast_in_data)
|
||||
@ -1260,7 +1261,7 @@ class Api:
|
||||
self.api_client = api_client
|
||||
|
||||
@staticmethod
|
||||
def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing.TypedDict], data: typing.Dict[str, typing.Any]):
|
||||
def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict], data: typing.Dict[str, typing.Any]):
|
||||
"""
|
||||
Ensures that:
|
||||
- required keys are present
|
||||
@ -1332,9 +1333,9 @@ class Api:
|
||||
return host
|
||||
|
||||
|
||||
class SerializedRequestBody(typing.TypedDict, total=False):
|
||||
class SerializedRequestBody(typing_extensions.TypedDict, total=False):
|
||||
body: typing.Union[str, bytes]
|
||||
fields: typing.Tuple[typing.Union[RequestField, tuple[str, str]], ...]
|
||||
fields: typing.Tuple[typing.Union[RequestField, typing.Tuple[str, str]], ...]
|
||||
|
||||
|
||||
class RequestBody(StyleFormSerializer, JSONDetector):
|
||||
|
@ -1,4 +1,4 @@
|
||||
import typing
|
||||
import typing_extensions
|
||||
|
||||
from unit_test_api.paths import PathValues
|
||||
from unit_test_api.apis.paths.request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body import RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody
|
||||
@ -176,7 +176,7 @@ from unit_test_api.apis.paths.response_body_post_uniqueitems_validation_response
|
||||
from unit_test_api.apis.paths.request_body_post_uniqueitems_false_validation_request_body import RequestBodyPostUniqueitemsFalseValidationRequestBody
|
||||
from unit_test_api.apis.paths.response_body_post_uniqueitems_false_validation_response_body_for_content_types import ResponseBodyPostUniqueitemsFalseValidationResponseBodyForContentTypes
|
||||
|
||||
PathToApi = typing.TypedDict(
|
||||
PathToApi = typing_extensions.TypedDict(
|
||||
'PathToApi',
|
||||
{
|
||||
PathValues.REQUEST_BODY_POST_ADDITIONALPROPERTIES_ALLOWS_ASCHEMA_WHICH_SHOULD_VALIDATE_REQUEST_BODY: RequestBodyPostAdditionalpropertiesAllowsASchemaWhichShouldValidateRequestBody,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import typing
|
||||
import typing_extensions
|
||||
|
||||
from unit_test_api.apis.tags import TagValues
|
||||
from unit_test_api.apis.tags.operation_request_body_api import OperationRequestBodyApi
|
||||
@ -30,7 +30,7 @@ from unit_test_api.apis.tags.required_api import RequiredApi
|
||||
from unit_test_api.apis.tags.type_api import TypeApi
|
||||
from unit_test_api.apis.tags.unique_items_api import UniqueItemsApi
|
||||
|
||||
TagToApi = typing.TypedDict(
|
||||
TagToApi = typing_extensions.TypedDict(
|
||||
'TagToApi',
|
||||
{
|
||||
TagValues.OPERATION_REQUEST_BODY: OperationRequestBodyApi,
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -44,28 +45,28 @@ class AdditionalpropertiesAllowsASchemaWhichShouldValidate(
|
||||
additional_properties = schemas.BoolSchema
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> MetaOapg.additional_properties: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo"], typing.Literal["bar"], str, ]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo"], typing.Literal["bar"], str, ]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
def __new__(
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -44,28 +45,28 @@ class AdditionalpropertiesAllowsASchemaWhichShouldValidate(
|
||||
additional_properties = schemas.BoolSchema
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> MetaOapg.additional_properties: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo"], typing.Literal["bar"], str, ]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[MetaOapg.additional_properties, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo"], typing.Literal["bar"], str, ]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo"], typing_extensions.Literal["bar"], str, ]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
def __new__(
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -44,29 +45,29 @@ class AdditionalpropertiesAreAllowedByDefault(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", "bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", "bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -44,29 +45,29 @@ class AdditionalpropertiesAreAllowedByDefault(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", "bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", "bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", "bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -51,23 +52,23 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -87,8 +88,7 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -51,23 +52,23 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -87,8 +88,7 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -55,23 +56,23 @@ class Allof(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -111,23 +112,23 @@ class Allof(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -147,8 +148,7 @@ class Allof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -55,23 +56,23 @@ class Allof(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -111,23 +112,23 @@ class Allof(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -147,8 +148,7 @@ class Allof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -104,8 +105,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -119,8 +119,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def one_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -134,8 +133,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -101,8 +102,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -116,8 +116,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def one_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -131,8 +130,7 @@ class AllofCombinedWithAnyofOneof(
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -81,8 +82,7 @@ class AllofSimpleTypes(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -79,8 +80,7 @@ class AllofSimpleTypes(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -64,23 +65,23 @@ class AllofWithBaseSchema(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -120,23 +121,23 @@ class AllofWithBaseSchema(
|
||||
baz: MetaOapg.properties.baz
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["baz", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["baz", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["baz", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["baz", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -156,8 +157,7 @@ class AllofWithBaseSchema(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -175,23 +175,23 @@ class AllofWithBaseSchema(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -64,23 +65,23 @@ class AllofWithBaseSchema(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -120,23 +121,23 @@ class AllofWithBaseSchema(
|
||||
baz: MetaOapg.properties.baz
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["baz", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["baz", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["baz"]) -> MetaOapg.properties.baz: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["baz", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["baz", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -156,8 +157,7 @@ class AllofWithBaseSchema(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
@ -175,23 +175,23 @@ class AllofWithBaseSchema(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,8 +37,7 @@ class AllofWithOneEmptySchema(
|
||||
all_of_0 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,8 +37,7 @@ class AllofWithOneEmptySchema(
|
||||
all_of_0 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTheFirstEmptySchema(
|
||||
all_of_1 = schemas.NumberSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTheFirstEmptySchema(
|
||||
all_of_1 = schemas.NumberSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTheLastEmptySchema(
|
||||
all_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTheLastEmptySchema(
|
||||
all_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTwoEmptySchemas(
|
||||
all_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AllofWithTwoEmptySchemas(
|
||||
all_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def all_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -59,8 +60,7 @@ class Anyof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -58,8 +59,7 @@ class Anyof(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -55,23 +56,23 @@ class AnyofComplexTypes(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -111,23 +112,23 @@ class AnyofComplexTypes(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -147,8 +148,7 @@ class AnyofComplexTypes(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -55,23 +56,23 @@ class AnyofComplexTypes(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -111,23 +112,23 @@ class AnyofComplexTypes(
|
||||
foo: MetaOapg.properties.foo
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
@ -147,8 +148,7 @@ class AnyofComplexTypes(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -82,8 +83,7 @@ class AnyofWithBaseSchema(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -80,8 +81,7 @@ class AnyofWithBaseSchema(
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AnyofWithOneEmptySchema(
|
||||
any_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,8 +38,7 @@ class AnyofWithOneEmptySchema(
|
||||
any_of_1 = schemas.AnyTypeSchema
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@functools.cache
|
||||
@functools.lru_cache()
|
||||
def any_of(cls):
|
||||
# we need this here to make our import statements work
|
||||
# we must store _composed_schemas in here so the code is only run
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWith0DoesNotMatchFalse(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def POSITIVE_0(cls):
|
||||
return cls(0)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWith0DoesNotMatchFalse(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def POSITIVE_0(cls):
|
||||
return cls(0)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWith1DoesNotMatchTrue(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def POSITIVE_1(cls):
|
||||
return cls(1)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWith1DoesNotMatchTrue(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def POSITIVE_1(cls):
|
||||
return cls(1)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,12 +38,10 @@ class EnumWithEscapedCharacters(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO_BAR(cls):
|
||||
return cls("foo\nbar")
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO_BAR(cls):
|
||||
return cls("foo\rbar")
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -37,12 +38,10 @@ class EnumWithEscapedCharacters(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO_BAR(cls):
|
||||
return cls("foo\nbar")
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO_BAR(cls):
|
||||
return cls("foo\rbar")
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWithFalseDoesNotMatch0(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FALSE(cls):
|
||||
return cls(schemas.BoolClass.FALSE)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWithFalseDoesNotMatch0(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FALSE(cls):
|
||||
return cls(schemas.BoolClass.FALSE)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWithTrueDoesNotMatch1(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def TRUE(cls):
|
||||
return cls(schemas.BoolClass.TRUE)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -36,7 +37,6 @@ class EnumWithTrueDoesNotMatch1(
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def TRUE(cls):
|
||||
return cls(schemas.BoolClass.TRUE)
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -49,8 +50,7 @@ class EnumsInProperties(
|
||||
schemas.StrSchema
|
||||
):
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def BAR(cls):
|
||||
return cls("bar")
|
||||
|
||||
@ -64,8 +64,7 @@ class EnumsInProperties(
|
||||
schemas.StrSchema
|
||||
):
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO(cls):
|
||||
return cls("foo")
|
||||
__annotations__ = {
|
||||
@ -76,29 +75,29 @@ class EnumsInProperties(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", "foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", "foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -49,8 +50,7 @@ class EnumsInProperties(
|
||||
schemas.StrSchema
|
||||
):
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def BAR(cls):
|
||||
return cls("bar")
|
||||
|
||||
@ -64,8 +64,7 @@ class EnumsInProperties(
|
||||
schemas.StrSchema
|
||||
):
|
||||
|
||||
@classmethod
|
||||
@property
|
||||
@schemas.classproperty
|
||||
def FOO(cls):
|
||||
return cls("foo")
|
||||
__annotations__ = {
|
||||
@ -76,29 +75,29 @@ class EnumsInProperties(
|
||||
bar: MetaOapg.properties.bar
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", "foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", "foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", "foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -42,23 +43,23 @@ class ForbiddenProperty(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -42,23 +43,23 @@ class ForbiddenProperty(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["foo"]) -> MetaOapg.properties.foo: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["foo"]) -> typing.Union[MetaOapg.properties.foo, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["foo", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["foo", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -50,23 +51,23 @@ class InvalidStringValueForDefault(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
@ -47,23 +48,23 @@ class InvalidStringValueForDefault(
|
||||
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: typing.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
def __getitem__(self, name: typing_extensions.Literal["bar"]) -> MetaOapg.properties.bar: ...
|
||||
|
||||
@typing.overload
|
||||
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...
|
||||
|
||||
def __getitem__(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def __getitem__(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
# dict_instance[name] accessor
|
||||
return super().__getitem__(name)
|
||||
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: typing.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
def get_item_oapg(self, name: typing_extensions.Literal["bar"]) -> typing.Union[MetaOapg.properties.bar, schemas.Unset]: ...
|
||||
|
||||
@typing.overload
|
||||
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...
|
||||
|
||||
def get_item_oapg(self, name: typing.Union[typing.Literal["bar", ], str]):
|
||||
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["bar", ], str]):
|
||||
return super().get_item_oapg(name)
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
@ -15,6 +15,7 @@ import functools # noqa: F401
|
||||
import io # noqa: F401
|
||||
import re # noqa: F401
|
||||
import typing # noqa: F401
|
||||
import typing_extensions # noqa: F401
|
||||
import uuid # noqa: F401
|
||||
|
||||
import frozendict # noqa: F401
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user