How to generate OpenAPI 3.0 YAML file from existing Spring REST API?

We have used lately springdoc-openapi java library. It helps automating the generation of API documentation using spring boot projects.

It automatically deploys swagger-ui to a spring-boot application
Documentation will be available in HTML format, using the official [swagger-ui jars]:

The Swagger UI page should then be available at http://server:port/context-path/swagger-ui.html and the OpenAPI description will be available at the following url for json format: http://server:port/context-path/v3/api-docs

  • server: The server name or IP
  • port: The server port
  • context-path: The context path of the application

Documentation can be available in yaml format as well, on the following path: /v3/api-docs.yml.
Add the library to the list of your project dependencies (No additional configuration is needed)

 <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-ui</artifactId>
      <version>1.2.3</version>
  </dependency>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)