You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using springfox-boot-starter:3.0.0 in my real project, the swagger ui expand complex type headers to internal fields, this fields to it's internal fields etc. till to java native classes.
I've created a small Spring Boot application demonstrating the issue. When you start the application, you'll can see in swagger-ui that header of type UserProfile expand to it's internal fields. Instead of it I waiting to see one field of type String, where I can paste json-file presents my object (for example: {"profileId":"1234567", "type":"student"}) and further my application deserialize it and uses as needed.
When you'll expand Demo controller, you see'll 14 fields instead of 5 (controller has 3 headers and 2 params)
I found the decision of this problem:
springfox.documentation.spring.web.readers.operation.OperationParameterReader
in method schouldExpand(...) need to add extra condition: && !parameter.hasParameterAnnotation(RequestHeader.class)
after this swagger-ui show all headers as expected.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When using springfox-boot-starter:3.0.0 in my real project, the swagger ui expand complex type headers to internal fields, this fields to it's internal fields etc. till to java native classes.
I've created a small Spring Boot application demonstrating the issue. When you start the application, you'll can see in swagger-ui that header of type UserProfile expand to it's internal fields. Instead of it I waiting to see one field of type String, where I can paste json-file presents my object (for example: {"profileId":"1234567", "type":"student"}) and further my application deserialize it and uses as needed.
How to reproduce:
Demo controller
, you see'll 14 fields instead of 5 (controller has 3 headers and 2 params)I found the decision of this problem:
springfox.documentation.spring.web.readers.operation.OperationParameterReader
in method schouldExpand(...) need to add extra condition:
&& !parameter.hasParameterAnnotation(RequestHeader.class)
after this swagger-ui show all headers as expected.
The text was updated successfully, but these errors were encountered: