Micronaut Swagger API

Project provides user-friendly integration for merging, exposing Swagger/OpenAPI files.

License

License

Categories

Categories

Micronaut Container Microservices Swagger Program Interface REST Frameworks
GroupId

GroupId

com.github.goodforgod
ArtifactId

ArtifactId

micronaut-swagger-api
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

Micronaut Swagger API
Project provides user-friendly integration for merging, exposing Swagger/OpenAPI files.
Project URL

Project URL

https://github.com/GoodforGod/micronaut-swagger-api
Source Code Management

Source Code Management

https://github.com/GoodforGod/micronaut-swagger-api/tree/master

Download micronaut-swagger-api

Dependencies

runtime (2)

Group / Artifact Type Version
org.jetbrains : annotations jar 20.1.0
io.micronaut : micronaut-http-server-netty jar

Project Modules

There are no modules declared in this project.

Micronaut Swagger API

Java CI Quality Gate Status Coverage Maintainability Rating

This project provides out-of-box user-friendly integration for merging Swaggers (OpenAPI also), exposing Swagger & Swagger-UI HTTP endpoints.

Dependency 🚀

Library ships ready for Micronaut 2.

Gradle

dependencies {
    compile 'com.github.goodforgod:micronaut-swagger-api:1.0.0'
}

Maven

<dependency>
    <groupId>com.github.goodforgod</groupId>
    <artifactId>micronaut-swagger-api</artifactId>
    <version>1.0.0</version>
</dependency>

Endpoints

Library provide exposure for statis resources:

  • /swagger - Endpoint for exposing merged Swagger (if there are any to merge) as static resource.
  • /swagger-ui - Endpoint for exposing Swagger UI page resource.
  • /rapidoc - Endpoint for exposing Rapidoc page resource.

Swagger

Library only exposes Swagger files, not generating them, so you need to generate Swagger for your service first and library will help with its exposure.

By adding to your Gradle dependencies:

annotationProcessor("io.micronaut.configuration:micronaut-openapi:2.1.0")
implementation("io.swagger.core.v3:swagger-annotations")

Check Micronaut official documentation for more information.

Configuration

Library provides out-of-box /swagger (merge enabled), /swagger-ui, /rapidoc endpoints.

There is ability to easily merge multiple Swagger files via simple configuration property.

Other settings are available to configure for service, however most of them are default for user-friendly bootstrap just by adding library as dependency.

swagger:
  enabled: true       // enalbed Swagger YAML exposing via HTTP endpoint  (default - true)
  merge: true         // enabled merging swaggers if multiple found       (default - true)
  exclude:            // Exclude some swagger files
  - swagger-1.yml
  - swagger-2.yml
  path: /swagger      // path for Swagger HTTP endpoint                   (default - /swagger)
  ui:
    path: /swagger-ui // path for Swagger-UI HTTP endpoint                (default - /swagger-ui)
    enalbed: true     // enalbed Swagger-UI exposing via HTTP endpoint    (default - true)
  rapidoc:
    path: /rapidoc    // path for Rapidoc HTTP endpoint                   (default - /rapidoc)
    enalbed: true     // enalbed Rapidoc exposing via HTTP endpoint       (default - false) 

Version History

1.0.0 - Initial version, with /swagger, /swagger-ui, /rapidoc HTTP endpoint support.

License

This project licensed under the Apache License 2.0 - see the LICENSE file for details.

Versions

Version
1.0.0