An open API service indexing awesome lists of open source software.

https://github.com/springdoc/springdoc-openapi-maven-plugin

Library for OpenAPI 3 with spring-boot
https://github.com/springdoc/springdoc-openapi-maven-plugin

Last synced: 10 months ago
JSON representation

Library for OpenAPI 3 with spring-boot

Awesome Lists containing this project

README

          

[![Build Status](https://ci-cd.springdoc.org:8443/buildStatus/icon?job=springdoc-openapi-maven-plugin-release)](https://ci-cd.springdoc.org:8443/view/springdoc-openapi/job/springdoc-openapi-maven-plugin-release/)

## **Introduction to springdoc-openapi-maven-plugin**

The aim of springdoc-openapi-maven-plugin is to generate json and yaml OpenAPI description during runtime. If you want to get swagger definitions properly, the application should completely running as locally.
The plugin works during integration-tests phase, and generate the OpenAPI description.
The plugin works in conjunction with spring-boot-maven plugin.

You can test it during the integration tests phase using the maven command:

```shell
mvn verify
```

In order to use this functionality, you need to add the plugin declaration on the plugins section of your pom.xml:

```xml


org.springframework.boot
spring-boot-maven-plugin
2.3.4.RELEASE

-Dspring.application.admin.enabled=true



pre-integration-test

start



post-integration-test

stop





org.springdoc
springdoc-openapi-maven-plugin
1.1


integration-test

generate



```

## **Custom settings of the springdoc-openapi-maven-plugin**

It possible to customise the following plugin properties:
* attachArtifact: install / deploy the api doc to the repository
* The default value is: false
* apiDocsUrl: The local url of your (json or yaml).
* The default value is: http://localhost:8080/v3/api-docs
* outputDir: The output directory, where to generate the OpenAPI description. The directory name shouldn't start with "/".
* The default value is: ${project.build.directory}
* outputFileName: The file name that contains the OpenAPI description.
* The default value is: openapi.json
* skip: Skip execution if set to true.
* The default value is: false
* headers: List of headers to send in request
* The default value is empty

```xml

org.springdoc
springdoc-openapi-maven-plugin
1.1


integration-test

generate




http://localhost:8080/v3/api-docs
openapi.json
home/springdoc/maven-output
false

header1value
header2value

```

# **Thank you for the support**

* Thanks a lot [JetBrains](https://www.jetbrains.com/?from=springdoc-openapi) for supporting springdoc-openapi project.

![JenBrains logo](https://springdoc.org/img/jetbrains.svg)