@Schema(hidden = true) does not work with data model class
See original GitHub issueHi,
I am Hanna Buklis, backend developer.
I started using springdoc-openapi-ui on my current project a few days ago.
I faced the following issue: I cannot hide on certain schema from ‘Schemas’ list in ui section.
Schemas list:
I checked documentation, it looks like @Schema(hidden = true) should hide a class from the list above.
My setup: Spring Boot 2.2.6.RELEASE springdoc-openapi: 1.4.3 springdoc-openapi-data-rest: 1.4.3
Entity class which I want to hide:
@AllArgsConstructor
@NoArgsConstructor
@Schema(hidden = true)
public class FailedUser {
@Id
private String id;
}
Application properties : springdoc.api-docs.resolve-schema-properties=true springdoc.api-docs.enabled=true springdoc.api-docs.path=/doc/definition springdoc.swagger-ui.path=/doc/docs springdoc.swagger-ui.supportedSubmitMethods=[“get”]
After this configuration, I expect FailedUser to be absent in ‘Schemas’ list. But it is still in place. Could you please tell me if this is a bug or wrong configuration?
Thank you in advance.
Best regards, Hanna Buklis.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
@bnasslahsen thanks bro. Issue solved! You helped me to solve the issue. The problem was that the controller of the model A wasn’t referencing it like you just showed me. Thanks a lot!
@jlorenzoC,
You have a lot of samples for test controllers in the project tests. For example, the code here:
If you have any other question, please make sure you provide the requested code samples.