Skip to content

Nullable array support fixes #929

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

Merged
merged 5 commits into from
Jan 4, 2024

Conversation

kgutwin
Copy link
Contributor

@kgutwin kgutwin commented Jan 3, 2024

Resolves #928 with two simple fixes:

  • Adds get_type_string() to ListProperty based on the definition in ModelProperty, since both arrays and objects are JSON-serialized in multipart mode.
  • Ensures that an empty list is used when UNSET is the default (initial) value when constructing a list property.

kgutwin and others added 2 commits January 3, 2024 15:09

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was signed with the committer’s verified signature.
dbanty Dylan Anthony
dbanty
dbanty previously approved these changes Jan 4, 2024
Copy link
Collaborator

@dbanty dbanty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix! It made me think about what intial_value was even doing and why all those extra type checks were in there. Turns out, the union property checks for Unset, so there's never a reason to have the inner property also check. Which means there's no reason for initial_value at all. This greatly simplified the generated code!

Verified

This commit was signed with the committer’s verified signature.
dbanty Dylan Anthony
@dbanty dbanty added this pull request to the merge queue Jan 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 4, 2024
@dbanty dbanty added this pull request to the merge queue Jan 4, 2024
Merged via the queue into openapi-generators:main with commit c10c1f2 Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nullable array models generate failing code
2 participants