How to hide Models section from swagger UI in spring boot? - spring-boot

I have a spring boot project in which I have integrated the swagger, for API documentation.
Now the problem is by default it is displaying the Models section, which is a security concern. I have tried, but unable to hide it. Also have gone through this link here
How to hide the Models section in Swagger UI?
But in this also, they are refering to some index.html file, but I only have backend with no frontend. So how to achieve the same, please help.
Thanks

Found it, Look at this github link.
https://github.com/eugenp/tutorials/blob/master/spring-boot-modules/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java

Related

How to edit css/html of Swagger UI page? (Spring boot)

Hi I am new to Swagger and Spring. I want to know how can I edit the swagger-ui.html page. I am using Pojo files to provide information related to parameters. What can I do to make this look better and proper? The reason I think this is happening is because I have used many Objects inside many objects. My assumption is, this should be solved using html and CSS but are getting it from swagger built-in dependencies, so can't be edited.
Assuming springdoc there is a documentation part for you: https://springdoc.org/#customizing-swagger-static-resources
You can customize swagger documentation static resources located in
META-INF/resources/webjars/swagger-ui/{swagger.version}/. The list of
resources includes: ... swagger-ui.css
And there is a code snippet.

Quarkus+Apache Camel+Swagger ui

I'm currently working on Quarkus with swagger ui and followed a link to test it below link successfully https://quarkus.io/guides/openapi-swaggerui.
but is there any way to implement apache camel route with swagger ui in quarkus? kindly help me.
If you add the camel-quarkus-openapi-java extension to your application, then you can add documentation to your REST DSL routes and have it rendered as an OpenAPI document. There's more information on how to do this here:
https://camel.apache.org/manual/latest/rest-dsl.html
Then you can configure the default URL that the Swagger UI points to.
For example, assuming you configured your Camel OpenAPI documentation to be served at /openapi.yaml, you can configure the Quarkus Swagger UI extension to consume it.
camel.rest.api-context-path = /openapi.yaml
quarkus.swagger-ui.urls.camel = /openapi.yaml

Custom swagger documentation/ Where is my swagger setup?

I have a jhipster based Spring project, which uses yarn/angular on the front end, and Spring on the back. I am with trying to figure out how to customize the swagger page. Currently it auto-populates new API's using swagger-ui, which is great, but I needed to add more custom info to those API's, hence my problem.
But I'm confused on what's running swagger. It looks like there's a node package called swagger-ui-dist and I also see a src/main/webapp folder with a swagger-ui folder, containing an index.html page.
I think what I pretty much want is to replace the current swagger-ui auto setup, with swagger that reads a file that I can create online using Swagger editor.
Apologies, for what I hope are simple questions. I'm brand new at swagger and npm/yarn.
Thanks
So after a bit more research, I found you could create your own OpenAPI doc, but an easier method in Spring is to annotate the endpoint methods with the #APIOperation annotation. There are other swagger specific annotations as well.
In the parameters, you can give value="", notes="" and a number of other customized values that will clarify what your API does in Swagger. Then swagger auto fills it in when bringing up your swagger page.
I hope that helps anyone with the same issue I had.

How to integrate magnolia blossom module with spring mvc

I have created web application in spring.So finally I got requirement to integrate a CMS to my project.I decided to use magnolia with blossom.I am new to magnolia and cms terminology.How should I integrate CMS to spring application.I referred documentation and some examples but I haven't got any clarity on it.So finally what's my doubt is how to integrate magnolia blossom with my spring application with out doing tight coupling.
These are the links I referred Refr Link.
Sample magnolia project Ref Link In this example they have given multi module maven project , in that one module for blossom and one for webapp magnolia.So here I haven't understood how to call my spring application to render my jsp pages or my app associated blog pages.
So please share your ideas or suggestion to implement a cms to spring....
The documentation you link is pretty clear on it
- to get things working you need to deploy Magnolia and your spring app in same war file.
- your spring controller becomes Magnolia page or component template. In case you need dialogs you create those in your code too by annotating appropriate code as a dialog.
- editing/placing of something at give URI/page location is then done via Magnolia using template (controller) found via annotation in your spring code.
If you have concrete issue, it would help to describe it and explain what you tried and what didn't work and where you are actually stuck.
Otherwise you perhaps want to try first few examples of working with just the CMS part of Magnolia and only once you understand that, start merging the two.

How to report/fix Spring framework documentation issues

I found few typos/mistakes in Spring Boot reference guide.
Could you please suggest whom can I contact, or even better how to fix it myself (e.g via pull request if possible) ?
I checked spring GitHub repository but spring-boot-actuator-docs seems to have nothing to do with reference guide.
Thanks in advance.
Spring Boot is like any regular github project. It is located here:
https://github.com/spring-projects/spring-boot
If you want to fix the typos, create a pull request. You'll find all you need to know in our contributing page. The documentation is located in the spring-boot-docs module

Resources