Skip to content
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

Fixes object serialization when there is an inline array property which contains a refed enum #8387

Merged
merged 2 commits into from
Jan 8, 2021

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Jan 8, 2021

Fixes object serialization when there is an inline array property which contains a refed enum
The problem was that when we convert the object model to a dict, we were not correctly handling the list of ModelSimple instances.
My code update fixes that.

@cgfarmer4 this should fix the bug that you filed

Tests:

  • test added showing instantiation of the model with the array property works
  • api serialization/deserialization test added

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@spacether spacether linked an issue Jan 8, 2021 that may be closed by this pull request
6 tasks
@spacether spacether changed the title Fixes object inline enum definition with refed enum item Fixes object inline enum with refed enum serialization Jan 8, 2021
@spacether spacether changed the title Fixes object inline enum with refed enum serialization Fixes object serialization when there is an inline array property which contains a refed enum Jan 8, 2021
@spacether spacether added this to the 5.0.1 milestone Jan 8, 2021
@spacether spacether merged commit ce893a8 into OpenAPITools:master Jan 8, 2021
@spacether spacether deleted the python_issue_8377 branch January 8, 2021 21:16
BulderKristian pushed a commit to BulderKristian/openapi-generator that referenced this pull request Jan 12, 2021
…ch contains a refed enum (OpenAPITools#8387)

* Fixes object inline enum defintion with refed enum item

* Adds refed array model example w/ serialization + deserialization
@cgfarmer4
Copy link
Contributor

Hi @spacether - heads up, I just ran latest-release from docker for python and this seems to be doing the thing again.

initial_products=[Products('assets')], ends up as {'value': Assets} in JSON

@spacether
Copy link
Contributor Author

What git hash is latest release from? We have a live test in master showing that this is fixed there.

@spacether
Copy link
Contributor Author

Can you please reopen your issue with more details?

@cgfarmer4
Copy link
Contributor

Oof sorry. User error. I will be on the look out for 5.0.1.

@spacether
Copy link
Contributor Author

Phew, scared me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Python not serializing enums correctly
3 participants