https://github.com/opengood-aio/openapi-docs-autoconfig
Spring Boot auto-configuration for OpenAPI documentation using Spring Doc
https://github.com/opengood-aio/openapi-docs-autoconfig
library protected-branches-true update-copyright-current-year
Last synced: 6 months ago
JSON representation
Spring Boot auto-configuration for OpenAPI documentation using Spring Doc
- Host: GitHub
- URL: https://github.com/opengood-aio/openapi-docs-autoconfig
- Owner: opengood-aio
- License: mit
- Created: 2019-12-11T18:41:02.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-06-07T22:07:43.000Z (about 1 year ago)
- Last Synced: 2025-07-28T10:40:24.637Z (12 months ago)
- Topics: library, protected-branches-true, update-copyright-current-year
- Language: Kotlin
- Homepage:
- Size: 217 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# OpenAPI Docs Auto Configuration
[](https://github.com/opengood-aio/openapi-docs-autoconfig/actions?query=workflow%3Abuild)
[](https://github.com/opengood-aio/openapi-docs-autoconfig/actions?query=workflow%3Arelease)
[](https://github.com/opengood-aio/openapi-docs-autoconfig/actions/workflows/codeql.yml)
[](https://codecov.io/gh/opengood-aio/openapi-docs-autoconfig)
[](https://github.com/opengood-aio/openapi-docs-autoconfig/releases/latest)
[](https://search.maven.org/search?q=g:%22io.opengood.autoconfig%22%20AND%20a:%22openapi-docs-autoconfig%22)
[](https://raw.githubusercontent.com/opengood-aio/openapi-docs-autoconfig/master/LICENSE)
Spring Boot auto-configuration for OpenAPI documentation using
[Spring Doc](https://springdoc.org/)
## Compatibility
* Java 21
* Spring Boot 3
## Setup
### Add Dependency
#### Gradle
```groovy
implementation("io.opengood.autoconfig:openapi-docs-autoconfig:VERSION")
```
#### Maven
```xml
io.opengood.autoconfig
openapi-docs-autoconfig
VERSION
```
**Note:** See *Release* version badge above for latest version.
## Configuration
OpenAPI Docs Auto Configuration simplifies configuration using a
YAML-based configuration approach.
### Properties
#### Main
| Property | Description | Default |
|--------------------|----------------------------------------------------------------|-----------------------------|
| `enabled` | Value indicating if OpenAPI Docs auto configuration is enabled | `true` |
| `paths` | List of API resource paths to include in docs | `/**` |
| `title` | API title | |
| `description` | API description | |
| `version` | API version | |
| `terms-of-service` | API terms of service description | |
| `contact` | API contact details | see *[Contact](#contact)* |
| `license` | API license details | see *[License](#license)* |
| `security` | API security details | see *[Security](#security)* |
#### Contact
| Property | Description | Default |
|----------|---------------------------|---------|
| `name` | API contact name | |
| `url` | API contact URL | |
| `email` | API contact email address | |
#### License
| Property | Description | Default |
|----------|------------------|---------|
| `name` | API license name | |
| `url` | API license URL | |
#### Security
| Property | Description | Default |
|----------------|---------------------------------------------------------------------------------------------------|-------------------------|
| `enabled` | Value indicating if OpenAPI Docs security is enabled | `true` |
| `name` | API security name | `default` |
| `description` | API security description | |
| `scheme` | API security scheme. Supported values (`bearer`, `basic`) | `basic` |
| `type` | API security type. Supported values (`http`, `apikey`) | `http` |
| `bearerFormat` | API security token bearer format. Supported values (`JWT`). Only required when `scheme = bearer`. | `JWT` |
| `oauth2` | API security OAuth2 details | see *[OAuth2](#oauth2)* |
#### OAuth2
| Property | Description | Default |
|--------------|--------------------------------------------------------------------------------|-------------------------------------------|
| `grant-type` | OAuth2 grant type. Supported values (`authorizationCode`, `clientCredentials`) | `authorizationCode` |
| `token-uri` | OAuth2 token URI | `http://localhost/oauth/token` |
| `resource` | OAuth2 resource details | see *[OAuth2 Resource](#oauth2-resource)* |
| `client` | OAuth2 client details | see *[OAuth2 Client](#oauth2-client)* |
#### OAuth2 Resource
| Property | Description | Default |
|----------------------------|---------------------------------|------------------------------------|
| `authorization-server-uri` | OAuth2 authorization server URI | `http://localhost/oauth/authorize` |
#### OAuth2 Client
| Property | Description | Default |
|----------|-----------------------------|---------|
| `scopes` | Map of OAuth2 client scopes | |
### Example
```yaml
open-api-docs:
enabled: true
paths:
- /greeting/**
title: test title
description: test description
version: test version
terms-of-service: http://test.tos.url
contact:
name: test contact name
url: http://test.contact.url
email: test@domain.com
license:
name: test license name
url: http://test.lic.url
security:
enabled: true
name: test security
description: test security description
scheme: bearer
type: http
bearer-format: jwt
oauth2:
grant-type: clientCredentials
resource:
authorization-server-uri: http://localhost/oauth2/authorize
client:
scopes:
test-1: test-scope-1
test-2: test-scope-2
token-uri: http://localhost/oauth2/token
```