Fix issue 18088: Missing the important statement for Datetime in Python binding generation (#18173)

* fix issue 18088

* update samples
This commit is contained in:
Zishun (Zack) WEI 2024-03-21 11:39:19 +08:00 committed by GitHub
parent 0b94817f58
commit 43ca5fcac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 4 deletions

View File

@ -1056,8 +1056,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
Set<String> exampleImports,
Set<String> postponedModelImports,
Set<String> postponedExampleImports,
PythonImports moduleImports,
String classname) {
PythonImports moduleImports = new PythonImports();
PydanticType pt = new PydanticType(
modelImports,
exampleImports,
@ -1250,6 +1250,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
exampleImports,
postponedModelImports,
postponedExampleImports,
moduleImports,
null
);
}
@ -2171,7 +2172,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// TODO process the first one only at the moment
if (cmt != null)
// 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);
} else {

View File

@ -17,6 +17,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from pydantic import StrictStr
from openapi_client.api_client import ApiClient, RequestSerialized
from openapi_client.api_response import ApiResponse

View File

@ -17,6 +17,7 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from pydantic import StrictStr
from openapi_client.api_client import ApiClient, RequestSerialized
from openapi_client.api_response import ApiResponse

View File

@ -16,7 +16,8 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
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 petstore_api.models.order import Order

View File

@ -16,7 +16,8 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
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 petstore_api.models.order import Order