forked from loafle/openapi-generator-original
Fix issue 18088: Missing the important statement for Datetime in Python binding generation (#18173)
* fix issue 18088 * update samples
This commit is contained in:
parent
0b94817f58
commit
43ca5fcac9
@ -1056,8 +1056,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
|||||||
Set<String> exampleImports,
|
Set<String> exampleImports,
|
||||||
Set<String> postponedModelImports,
|
Set<String> postponedModelImports,
|
||||||
Set<String> postponedExampleImports,
|
Set<String> postponedExampleImports,
|
||||||
|
PythonImports moduleImports,
|
||||||
String classname) {
|
String classname) {
|
||||||
PythonImports moduleImports = new PythonImports();
|
|
||||||
PydanticType pt = new PydanticType(
|
PydanticType pt = new PydanticType(
|
||||||
modelImports,
|
modelImports,
|
||||||
exampleImports,
|
exampleImports,
|
||||||
@ -1250,6 +1250,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
|||||||
exampleImports,
|
exampleImports,
|
||||||
postponedModelImports,
|
postponedModelImports,
|
||||||
postponedExampleImports,
|
postponedExampleImports,
|
||||||
|
moduleImports,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -2171,7 +2172,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
|||||||
// TODO process the first one only at the moment
|
// TODO process the first one only at the moment
|
||||||
if (cmt != null)
|
if (cmt != null)
|
||||||
// TODO: don't loop back to the deprecated getPydanticType method
|
// TODO: don't loop back to the deprecated getPydanticType method
|
||||||
return getPydanticType(cmt.getSchema(), modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname);
|
return getPydanticType(cmt.getSchema(), modelImports, exampleImports, postponedModelImports, postponedExampleImports, moduleImports, classname);
|
||||||
}
|
}
|
||||||
throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
|
throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,6 +17,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
|
from pydantic import StrictStr
|
||||||
|
|
||||||
from openapi_client.api_client import ApiClient, RequestSerialized
|
from openapi_client.api_client import ApiClient, RequestSerialized
|
||||||
from openapi_client.api_response import ApiResponse
|
from openapi_client.api_response import ApiResponse
|
||||||
|
@ -17,6 +17,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
|
from pydantic import StrictStr
|
||||||
|
|
||||||
from openapi_client.api_client import ApiClient, RequestSerialized
|
from openapi_client.api_client import ApiClient, RequestSerialized
|
||||||
from openapi_client.api_response import ApiResponse
|
from openapi_client.api_response import ApiResponse
|
||||||
|
@ -16,7 +16,8 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
from pydantic import Field, StrictStr
|
from pydantic import Field, StrictInt, StrictStr
|
||||||
|
from typing import Dict
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from petstore_api.models.order import Order
|
from petstore_api.models.order import Order
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
from pydantic import Field, StrictStr
|
from pydantic import Field, StrictInt, StrictStr
|
||||||
|
from typing import Dict
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
from petstore_api.models.order import Order
|
from petstore_api.models.order import Order
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user