microprofile-extensions / openapi-ext

Some extensions for MicroProfile OpenAPI
Apache License 2.0
22 stars 13 forks source link

Add posibility to hide models #39

Closed johanasterholm closed 2 years ago

johanasterholm commented 2 years ago

This change adds the possibility to hide the models section on the swagger UI. This is done by introducing a new property openapi.ui.modelsVisibility which defaults to visible. Setting this to hidden will hide the section in the UI.

phillip-kruger commented 2 years ago

Hi @johanasterholm ! Thanks very much for your PR. I am happy with your code, but I just want to check, did you try and see if you can not rather use the swagger ui properties to do this (setting defaultModelsExpandDepth to -1) That would still require some code changes here, but then at least it use the built in way rather than css. Let me know

see https://stackoverflow.com/questions/57138564/how-to-hide-the-models-section-in-swagger-ui

johanasterholm commented 2 years ago

Hi @phillip-kruger , No I did not try this. Let me try that and I will get back to you

johanasterholm commented 2 years ago

This is possible as well: Should I delete this pull request and create a new one? Here is how the code looks like with that change: https://github.com/microprofile-extensions/openapi-ext/compare/main...johanasterholm:models_optional

phillip-kruger commented 2 years ago

I think that is better. W.d.y.t ?

johanasterholm commented 2 years ago

I agree. I have updated this pull request

phillip-kruger commented 2 years ago

Thanks, I'll have a look later and merge and release