Is it possible to generate the swagger api.yaml from JDL?
I've created and app with swagger addon and then imported entities from jdl but the swagger api.yaml is empty
That specific api.yml is intended for JHipster's API First Development feature.
JHipster comes configured with Springfox, which automatically generates the Swagger docs based on the project's code. You can access the app's Swagger config after starting the app at http://localhost:8080/v2/api-docs. It is in JSON format by default, if you need YAML you can upload it to the Swagger Editor
You can also view the docs in a built-in SwaggerUI at http://127.0.0.1:8080/#/docs, normally located under the Administration navbar menu.
Related
Created a new Spring Initializer project in IntelliJ using Spring Boot version 3.0.2.
Included Spring Web and Spring Boot Actuator.
Did the same using Spring Boot version 2.7.8.
Both projects have the following in application.properties
management.endpoints.web.exposure.include=info
management.info.build.enabled=true
spring.jackson.serialization.indent-output=true
When requesting /actuator/info for version 3.0.2 project, the JSON is not indented or pretty printed.
The same request for version 2.7.8 project returns pretty printed and indented JSON.
Everything is left default, no code additions, config changes. etc. Just plain vanilla out of the box project.
Is this a bug in Spring Boot version 3?
Expected the JSON response to be pretty printed and indented as per the Spring documentation for the Application Properties settings.
This change has been introduced in Spring Boot 3 on purpose: changing a JSON configuration in your main application should not change the JSON format used by actuator, as it could confuse clients relying on the format to be the same for all Spring Boot applications.
See the related issuue and also the dedicated section in the migration guide. You can revert to the previous behavior by setting the management.endpoints.jackson.isolated-object-mapper=false configuration property.
In my spring boot project, I have an openapi3 yaml definition of API used by swagger UI. I need to be able to dynamically change a part of server URL while using the UI and I was able to configure it in yaml
openapi: 3.0.1
info:
title: Foo Service
version: v1.0
servers:
- url: https://{foo}.com
variables:
foo:
default: bar
which makes the UI look like that
Now, I'd like to stop using yamls to define my API and use annotations and configuration beans instead. I feel like the way to go would be to set servers field in io.swagger.v3.oas.models.OpenAPI bean, however I have no idea what to do considering I want the URL to be dynamically changed by the swagger UI.
Any guidance will be much appreciated
Recently I found my swagger UI document shows so much api entry point. Finally I found that the document also shows other project entry point. For example, Spring Boot project A imported Spring Boot project B and C, but the Spring Boot project A shows A + B + C's api entry point in project A's swagger UI, is it possible to make project A ignore other project rest api entry point and only show project A itself? I search from internet seems no one facing this problem. My swagger gradle dependencies like this:
api "io.springfox:springfox-boot-starter:3.0.0"
Add in spring configuration Docket and than set correct package for your api. Example: https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api. Use method: RequestHandlerSelectors.basePackage, for narrow scaning.
We've created a Spring Boot application with some property sources configuring the modules of application. Now it comes to document configuration of the application. Instead of writing a separate document I'd like to document in code and create documentation.
First naiv approach would be to write property files like this and then generate a default application.properties (or yaml) to be adapted by end user:
a.b.c.myProperty=42
a.b.c.myProperty.desc=This is the documentation for myProperty
a.b.c.foo=baa
a.b.c.foo.desc=foo is the most important parameter ever!
Before reinventing the wheel, is there already some way to create configuration documentation out of my property sources?
I am creating microservice with java class using #ApiModelProperty annotation for swagger documentation.
Is it possible to generate HTML swagger documentation from this file using some IntelliJ plugin without deploying my microservice?