Skip to content

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.

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!

@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