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
@Schema(hidden = true) does not work with data model class #826
Comments
Hi @abuklis, Not sure which springdoc documentation you are refering to about the usage of @Schema on the class level: Here is the code snippet, that shows it. ResolvedSchema resolvedSchema = ModelConverters.getInstance()
.resolveAsResolvedSchema(
new AnnotatedType(FailedUser.class).resolveAsRef(true));
Assert.isNull(resolvedSchema.schema, "The schema should be hidden."); This is said, you have many workarounds depending on your case:
|
Hi @bnasslahsen , I'm new at springdoc openapi 3 cuz I'm collaborating on a project that is using it. So, in my case my problem is that I'm not seeing in this object schemas list, some already defined models. Some models are there, but others are not.
Please, why is that happening? Cheers. |
You should have the getter/setter, for all your fields. |
Thanks @bnasslahsen for your fast reply. In this context, how would you reference a model A in a controller to get it to work? |
You have a lot of samples for test controllers in the project tests. If you have any other question, please make sure you provide the requested code samples. |
@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! |
Hi,
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:
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.
The text was updated successfully, but these errors were encountered: