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.yaml. (to convert into yaml) 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>
Answer from user11878890 on Stack Overflow
Top answer
1 of 2
29

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.yaml. (to convert into yaml) 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>
2 of 2
5

I was missing some library for this for longer time. Finally, decided to implement my own generator https://github.com/jrcodeza/spring-openapi maybe you can check it out too. It's based on reflection and supports javax and spring annotations. It also generates inheritance model (with discriminators) based on Jackson annotations. Besides you can define your own interceptors if you want to alter generation process (e.g. when you have your own annotations and need to adjust generated sections of schema). You can use it in runtime mode or as a maven plugin. There is also OpenAPI3 to java client generator, which generates the model. Again it generates also Javax annotations and Jackson annotations for correct inheritance.

🌐
OpenAPI Generator
openapi-generator.tech › docs › generators › openapi-yaml
Documentation for the openapi-yaml Generator | OpenAPI Generator
December 13, 2023 - These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to configuration docs for more details
🌐
JetBrains
jetbrains.com › help › idea › openapi.html
OpenAPI | IntelliJ IDEA Documentation
February 17, 2026 - These are regular YAML or JSON files with the definition of the OpenAPI specification version. In the Project tool window, press Alt+Insert and select OpenAPI Specification from the context menu.
🌐
Swagger
swagger.io › docs › specification › v3_0 › basic-structure
Basic Structure | Swagger Docs
You can write OpenAPI definitions in YAML or JSON. In this guide, we use only YAML examples but JSON works equally well.
🌐
I'd Rather Be Writing
idratherbewriting.com › learnapidoc › pubapis_yaml.html
Working in YAML (OpenAPI tutorial) | I'd Rather Be Writing Blog and API doc course
2 weeks ago - An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format. (See Format) In other words, the OpenAPI document you create is a JSON object, but you have the option of expressing the JSON using either JSON or YAML syntax.
🌐
Redocly
redocly.com › learn › openapi › learning-openapi
Introduction to OpenAPI
You can use `markdown` here. operationId: getUserByName parameters: - name: username in: path description: The name that needs to be fetched required: true schema: type: string - name: with_email in: query description: Filter users without email schema: type: boolean security: - main_auth: - 'read:users' - api_key: [] responses: '200': description: Success content: application/json: schema: $ref: ../components/schemas/User.yaml example: username: user1 email: user@example.com '403': description: Forbidden '404': description: User not found put: tags: - User summary: Updated user description: T
🌐
Nordic APIs
nordicapis.com › how-to-build-an-openapi-definition-file-step-by-step
How to Build an OpenAPI Definition File (Step by Step) | Nordic APIs |
June 26, 2025 - We’ll be making a sample definition that describes how a simple to-do list API operates. First, in your text editor of choice, create a file named openapi.yaml in the root directory.
🌐
GitHub
github.com › Redocly › openapi-starter › blob › main › openapi › openapi.yaml
openapi-starter/openapi/openapi.yaml at main · Redocly/openapi-starter
OpenAPI starter repository. Contribute to Redocly/openapi-starter development by creating an account on GitHub.
Author   Redocly
Find elsewhere
🌐
GitHub
github.com › Redocly › openapi-template › blob › gh-pages › openapi.yaml
openapi-template/openapi.yaml at gh-pages · Redocly/openapi-template
OpenAPI/Swagger 2.0 template, intended to be good starting point for describing your API - openapi-template/openapi.yaml at gh-pages · Redocly/openapi-template
Author   Redocly
🌐
OpenAPI Generator
openapi-generator.tech › usage
Usage | OpenAPI Generator
openapi-generator-cli generate -i petstore.yaml -g typescript-fetch -o out \ -c config.yaml · The batch command allows you to move all CLI arguments supported by the generate command into a YAML or JSON file.
🌐
Baeldung
baeldung.com › home › web services › building open api documentation using yml file in resources folder
Building Open API Documentation Using YML File in Resources Folder | Baeldung
September 16, 2025 - We’ll keep all the code needed to generate APIs separate, following the Swagger parsing rules. We’ll also understand the implementation from scratch for generating Swagger UI using YML file. Let’s check the case of putting Swagger logic in a separate Swagger (YML or JSON) file: openapi: 3.0.1 info: title: User API version: "1.0" description: API for User Management paths: /users/all: get: summary: Get all users description: Returns a list of users responses: "200": description: Successful response
🌐
SmartBear
support.smartbear.com › swaggerhub › docs › en › get-started › openapi-3-0-tutorial.html
OpenAPI 3.0 Tutorial | SwaggerHub Documentation
The Specification was originally developed in 2010 by Reverb Technologies (formerly Wordnik) to keep the API design and documentation in sync. It has since become a de-facto standard for designing and describing RESTful APIs and is used by millions of developers and organizations for developing their APIs, be it internal or client-facing. The latest version of OpenAPI is 3.0. OpenAPI definitions can be written in JSON or YAML.
🌐
Redocly
redocly.com › docs › resources › learning-openapi
Introduction to OpenAPI 3.0
September 15, 2023 - You can use `markdown` here. operationId: getUserByName parameters: - name: username in: path description: The name that needs to be fetched required: true schema: type: string - name: with_email in: query description: Filter users without email schema: type: boolean security: - main_auth: - 'read:users' - api_key: [] responses: '200': description: Success content: application/json: schema: $ref: ../components/schemas/User.yaml example: username: user1 email: user@example.com '403': description: Forbidden '404': description: User not found put: tags: - User summary: Updated user description: T
🌐
Microsoft Learn
learn.microsoft.com › en-us › aspnet › core › fundamentals › openapi › aspnetcore-openapi
Generate OpenAPI documents | Microsoft Learn
The following sections demonstrate how to customize OpenAPI document generation. The OpenAPI document can be generated in either JSON or YAML format. By default, the OpenAPI document is generated in JSON format.
🌐
Blazemeter
blazemeter.com › blog › openapi-spec-from-code
How to Generate an OpenAPI Spec From Code | Perforce BlazeMeter
Virtually all packages listed above allow the conversion of your code, configuration, and annotations into an OpenAPI definition in real time and add an endpoint to the web server that distributes this file in JSON or YAML format. Furthermore, the packages come bundled with SwaggerUI, the browser-based interactive API playground from the Swagger project.
🌐
OpenAPI
learn.openapis.org › specification › structure.html
Structure of an OpenAPI Description
However, YAML being a superset of JSON means that both syntaxes can be mixed. While this is not recommended in general, it can come in handy sometimes. For example: anObject: aString: This is a string arrayOfNumbers: [ 1, 2, 3 ] # Abbreviated array representation · Finally, object field names are case-sensitive: openapi is not the same thing as OpenAPI. NOTE: Ellipses (…) are used throughout this guide to indicate an incomplete code snippet.
🌐
Apigee
docs.apigee.com › api-platform › tutorials › tutorial-create-spec
Create an OpenAPI Specification | Apigee Edge | Apigee Docs
To create an OpenAPI Specification that models the API that calls the Node.js server. Sign in to apigee.com/edge. Select Develop > Specs in the side navigation bar. The list of specifications is displayed. Click + Spec and select New Spec in the drop-down menu.
🌐
LornaJane
lornajane.net › posts › 2020 › creating-a-simple-openapi-spec
Creating a Simple OpenAPI Spec | LornaJane
August 6, 2020 - I recently made a very simple spec ... to create a spec for the first time. OpenAPI specs are very verbose so this very tiny API makes quite a manageable example! For the impatient: if you just want to look at an example without any additional context, there’s a spec here https://github.com/lornajane/flask-planets-and-webhooks/blob/master/openapi.yaml...