Skip to content

openapi-tools/gradle-swagger-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Build Status

This Gradle plugin is created to generate OpenAPI documentation from a JAX-RS based project using Swagger.

Usage

Applying the plugin to your project the generation will run Swagger to generate OpenAPI documentation after classes are compiled. Applying this plugin will also imply applying the Java plugin. A minimal configuration is as follows.

buildscript {
    dependencies {
        classpath (group: 'dk.bankdata.gradle.swagger', name: 'gradle-swagger-plugin', version: '2.0.0')
    }
}

apply plugin: 'dk.bankdata.swagger'

swagger {
    resourcePackages = ['dk.bankdata.service.example']
}

It is possible to configure most of the general properties of the OpenAPI document with the configuration in the build file. This implies using variable from the build file if applicable.

buildscript {
    dependencies {
        classpath (group: 'dk.bankdata.gradle.swagger', name: 'gradle-swagger-plugin', version: '2.0.0')
    }
}

apply plugin: 'dk.bankdata.swagger'

swagger {
    resourcePackages = ['dk.bankdata.gradle.swagger.example']
    servers = [
            {
                url = "https://api.bankdata.dk"
                description = "production"
            }
    ]
    info {
        title = 'Swagger Plugin Full'
        version = '1.0.0'
        description = 'This service does...'
        termsOfService = 'Terms'
        contact {
            name = 'Bankdata'
            url = 'https://www.bankdata.dk'
            email = 'bankdata@e.mail'
        }
        license {
            name = 'MIT'
            url = 'http://mit'
        }
    }
}

Acknowledgements

The Gradle Swagger Plugin is inspired by the Swagger Maven Plugin and also the Swagger Gradle Plugin. However this plugin was created with the specific purpose of using as much of the core Swagger modules as possible.

About

Gradle plugin for generating OpenAPI specification using Swagger

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy