I have a Spring Boot project and I'm using swagger to test and document the API. The project also contains a bunch of classes that are used as libraries and I'm using scala docs to document those. Is there a way to unify API docs (from swagger) and Scala Docs as I'm hosting the docs using maven site plugin.
Related
For years, I've used Spring Initializr (at https://start.spring.io/) to create the initial SpringBoot application and then modify it to create the app. This works fine.
Is there a maven archetype I can use to create a SpringBoot app? Or is the Spring Initializr the only way to do this.
Searching I found this:
What archetype to choose for a simple java project
Which shows the command:
mvn archetype:generate -Dfilter=org.apache.maven.archetypes:
Which gives me a list of 14 items to choose from. None of them mention SpringBoot.
The closest match is org.apache.maven.archetypes:maven-archetype-webapp, so I tried it and it created a WebApp (*.war) which is not what I'm looking for.
The aim of the Maven archetype is for generating a project skeleton. The Spring Initialiser also does the same but I think you should find it more user friendly to use when compared to executing a maven archetype command.
If you insist to use maven archetype , you can simply search Github to see if there are people share their archetypes (search result at here)
If your aim is just to use command to generate a spring-boot project skeleton , Spring Initializr actually provide an HTTP API to do it.
Also you can checkout JHipster, which is another tool to generate a spring-boot project skeleton.
You could also use Spring Boot CLI to scaffold new Spring Boot projects:
spring init --dependencies=web,data-jpa my-new-project
It works just as Spring Initializr, but on the command line.
See section 2.4 "Initialize a New Project" on Spring Boot CLI documentation here: https://docs.spring.io/spring-boot/docs/current/reference/html/cli.html#cli.using-the-cli.initialize-new-project
I have a spring boot project, after running I can open the swagger URL.
I have mentioned two groups for my swagger:
External
Internal
I am looking for a way, where if I provide external API URL to customers, they will not be able to see internal APIs and vice versa.
Is there a way, we can have two different URLs for a swagger document?
Note: I am using springdoc-openapi-ui library for this.
What's the purpose of spring-project/spring-framework repository in GitHub?
How to run this applications using eclipse?
This is where Spring Framework source code is hosted.
If you want to start using Spring, you don't need their Github repository, I'd recommend starting at their official site: https://projects.spring.io/spring-framework/ There you can find the documentation, description of the subprojects that comprise Spring Framework, as well as instructions of how to use it. There is an example on their main page.
If you want to build an application, you could take a look at Spring Boot: https://projects.spring.io/spring-boot/ The site, again, contains documentation, guides, examples and so on.
Here you can find information on how to run your Spring Boot application in Eclipse: https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html
They have their own IDE based on Eclipse: https://spring.io/tools/sts
And if you want to rebuild Spring from source or (more likely) learn how it works, then its Github repo will be useful for you.
I am using apache camel REST DSL using springboot. All the configuration works fine. Now I want to add REST documentation using camel swagger java component. The REST DSL and swagger java, works out of the box. I can see the JSON output of the exposed REST services.
Now Question, what steps I need to follow, such that i can view camel REST documentation using swagger-ui?
I searched for answers, however the only solution was to download swagger-ui from github and "copy" <dist> folder to project, this doesn't seems to work, getting 404. URL i am using is localhost:8081\rest\index.html.
I liked the spring-fox swagger2, is it something can be supported in camel?
See this example which includes swagger ui.
https://github.com/apache/camel/tree/master/examples/camel-example-swagger-xml
The index.html file has more details how to access the swagger ui when the application runs.
I am trying to use Swagger in the existing Wink restful web services. I have done all the annotations as mentioned in the swagger documentation but now I need to integrate the rest of the stuff. E.g. configuring the swagger UI, setting up the swagger configurations during server startup etc. Can any one point me to any documentation or provide some steps to follow?
I have just made a project for Apache Wink. You can find it below
https://github.com/zouzias/swagger-jaxrs-wink
I will push it to the swagger-core samples collections asap as well.