-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
When the return value defined by the @ Success tag is equal to a null value, a null pointer exception occurs #1653
Comments
addice1019
changed the title
The return value structure defines a null pointer exception with a value equal to nil
When the return value defined by the @ Success tag is equal to a null value, a null pointer exception occurs
Aug 21, 2023
May I ask why need null? |
The project coexists with the Springboot project and requires a unified JSON return value |
What do you think of the solution in #1667 ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When the return value defined by the @ Success tag is equal to a null value, a null pointer exception occurs
To Reproduce
Steps to reproduce the behavior:
Response {data=nil} in the structure
Run the command swag init in cmd
Invalid memory address or nil pointer dereference discovered through debugging
Expected behavior
Can swaggo parse comments in the returned structure that are equal to nil, such as utils. Response {data=nil}
Expected swaggo doc definition
Expected JSON return value
Your swag version
v1.16.1
Your go version
go1.20.5
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: