-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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][golang][7.3.0] Generated model accessor functions have incorrect boolean logic for array types #17835
Labels
Comments
sagarkhot3
added a commit
to sagarkhot3/openapi-generator
that referenced
this issue
Feb 10, 2024
I think so can you please file a PR when you've time? |
@wing328 looks like @sagarkhot3 already created a fix here: #17840, if you can help take a look at that - thanks! |
wing328
added a commit
that referenced
this issue
Feb 15, 2024
* #17835 changed to return !IsNil * update samples --------- Co-authored-by: sagar khot <[email protected]>
kota65535
pushed a commit
to kota65535/openapi-generator
that referenced
this issue
Feb 23, 2024
* OpenAPITools#17835 changed to return !IsNil * update samples --------- Co-authored-by: sagar khot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given a schema with a field that has type
array
like this:our generated models have functions like:
shouldn't the boolean to check if the Foo model has data be
o != nil && !IsNil(o.Data)
, rather thano != nil && IsNil(o.Data)
?another accessor function also gets generated:
GetDataOk
seems correct, and applying DeMorgan's law, that indicatesHasData
should useo != nil && !IsNil(o.Data)
We are using v7.3 openapi-generator, but we believe the issue is present in 7.2 as well
The text was updated successfully, but these errors were encountered: