-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][Python] deepObject parameter style creates invalid code on 5.0.1 and raises exception on 5.1.1 #9603
Comments
How about instead implementing proper serialization/deserialization for deepobject? |
@spacether it's on the mid term agenda for me, as a starting point I want don't crash at gen time and a option to configure the serializer We also need the sercer/connexion side at some point |
Doesn't openapi define what deepobject should do? Do you have a use case where you need to customize how it behaves? |
@spacether deepObject is an utterly painful "standard" left for implementations, there are some non-formal ones for php/ruby, but there is no implementation for python that's standardized, so is not something i will start soon as it will need a good setup to be sane also i don't want to just put a parser hack into openapi-codegen sincei ts jsut going to be a mess then |
Any update on this? |
No one has written this feature yet. If you want it, please consider writing a PR adding it in python-experimental One could implement it the same way that other libraries do per here: OAI/OpenAPI-Specification#1706 |
I don't mind updating the template, but I don't have an environment to fix the exception being thrown:
|
Example OpenAPI.json schema that shows this issue. |
May also be related to #11234 |
@kevinkirkup my PR will fix the NPE issue but does not add the deep object serialization |
Bug Report Checklist
Description
when having a spec with deep objects parameter style, the python codegen creates invalid code on generator
5.0.x
and fails altogether on generator5.1.x
on
5.0.x
the bad code generated looks likeapi_50/api/hosts_api.py:from api_50.model.str_bool_date_datetime_dict_float_int_list_str_none_type import StrBoolDateDatetimeDictFloatIntListStrNoneType
on
5.1.x
even considering them triggersopenapi-generator version
5.1.1
5.0.1
OpenAPI declaration file content or url
api spec
relevant item is a used
Generation Details/ steps to reproduce
Related issues/PRs
i haven't found anything quite related
Suggest a fix
my current workaround is to use 5.1.x templates , the 5.0.x codegen and to post-process the generated files dropping the bad lines
it would be nice if there was a configuration option to set a
deep_object_hook
so users can provide a own serialization/de-serialization for deep_objectsThe text was updated successfully, but these errors were encountered: