forked from loafle/openapi-generator-original
python: adjust basic typing information (#17511)
* python: adjust basic typing information This is an initial pass to fix and adjust the typing information for the generated client. This is enough to have mypy runnning without complains on all the (modern) generated clients (Pydantic v1 code is not checked for instance) mypy is also now run directly in the CI, so further changes will also be checked and thus, will need to be compliant with good typing information. Note that this doesn't *fully* type all the code: mypy is not run in "strict" mode and there are still many functions/methods/attributes which are still not fully typed, but it's a first good step in that direction. * ApiResponse's raw_data can't be None * Fix indentation * Revert test changes * run mypy on tests/ directory * don't forcefully convert the client response headers to dict * override petstore ApiResponse model * adjust type of 'any/one_of_schemas' fields
This commit is contained in:
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
|
||||
from openapi_client.api_client import ApiClient
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from pydantic import Field, StrictBytes, StrictStr
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from pydantic import StrictBool, StrictInt, StrictStr
|
||||
from typing import Optional
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from pydantic import StrictBool, StrictInt, StrictStr, field_validator
|
||||
from typing import Optional
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from pydantic import StrictInt, StrictStr, field_validator
|
||||
from openapi_client.models.string_enum_ref import StringEnumRef
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
import warnings
|
||||
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
from typing import Annotated
|
||||
except ImportError:
|
||||
from typing_extensions import Annotated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from datetime import date, datetime
|
||||
from pydantic import StrictBool, StrictInt, StrictStr, field_validator
|
||||
|
||||
Reference in New Issue
Block a user