-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
openapi3gen does not generate nullable: true
for pointers
#968
Comments
You can still work around it using SchemaCustomizer and custom StructTag.
For the solution to the problem, this is where we lose the "pointer" information https://github.com/getkin/kin-openapi/blob/master/openapi3gen/openapi3gen.go#L204-L206 I think something like following should solve the problem:
I did run the tests you pointed and it seems to work. I am not sure if there are edge cases for but I am happy to raise a PR if this is acceptable. On the other hand, openapi3gen seems to be trying to be minimalisti. For example, you also don't get |
@endertunc your patch proposal seems very reasonable. Please open a PR :) |
This should include
"nullable": true
https://github.com/getkin/kin-openapi/blob/master/openapi3gen/openapi3gen_test.go#L115-L117
This issue is not possible to fix using
openapi3gen.SchemaCustomizer
becausereflect.Type
passed intoopenapi3.SchemaCustomizerFn
is never a pointer.The text was updated successfully, but these errors were encountered: