All Projects → swagger-api → swaggerhub-gradle-plugin

swagger-api / swaggerhub-gradle-plugin

Licence: Apache-2.0 License
Gradle plugin for SwaggerHub

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to swaggerhub-gradle-plugin

vlsi-release-plugins
A set of plugins to simplify Gradle release tasks
Stars: ✭ 30 (+114.29%)
Mutual labels:  gradle
EmbeddedTools
Additions to the model-based DSL for deploying Java and Native projects to remote targets
Stars: ✭ 14 (+0%)
Mutual labels:  gradle
gradle-aem-multi
Example Multi-Module AEM application built by Gradle Build System
Stars: ✭ 31 (+121.43%)
Mutual labels:  gradle
gradle-cleaner-intellij-plugin
Force clear delaying & no longer needed Gradle tasks.
Stars: ✭ 26 (+85.71%)
Mutual labels:  gradle
sphinx-gradle-plugin
Sphinx site generation plugin for Gradle
Stars: ✭ 19 (+35.71%)
Mutual labels:  gradle
karibu10-helloworld-application
Karibu-DSL HelloWorld application in Vaadin 14
Stars: ✭ 14 (+0%)
Mutual labels:  gradle
nexus-publish-plugin
⚠️ Deprecated - please switch to https://github.com/gradle-nexus/publish-plugin
Stars: ✭ 38 (+171.43%)
Mutual labels:  gradle
dagger2-kotlin
dagger2,querydsl kotlin 1.5.x annotation processor, gradle 7.x
Stars: ✭ 56 (+300%)
Mutual labels:  gradle
MicroServiceExample
针对微服务的各种例子实现
Stars: ✭ 25 (+78.57%)
Mutual labels:  gradle
gradle-localization-plugin
Gradle plugin for automating the download process of localization files.
Stars: ✭ 19 (+35.71%)
Mutual labels:  gradle
heroku-buildpack-gradle
This is a Heroku buildpack for Gradle apps. It uses Gradle to build your application and OpenJDK to run it.
Stars: ✭ 58 (+314.29%)
Mutual labels:  gradle
MultiLamp
Android library to showcase/highlight the multiple views on same overlay
Stars: ✭ 235 (+1578.57%)
Mutual labels:  gradle
DexHelper
Gradle Plugin to analyze per-dex with Android assemble command.
Stars: ✭ 19 (+35.71%)
Mutual labels:  gradle
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (+121.43%)
Mutual labels:  gradle
gradle-build-info-plugin
Gradle plugin to include build information such as Git commit ID to your JAR. It can be used to show Git commit information with Spring Boot Actuator.
Stars: ✭ 33 (+135.71%)
Mutual labels:  gradle
android-easy-gcm
Use this library to add GCM to your project, only in a few minutes !
Stars: ✭ 50 (+257.14%)
Mutual labels:  gradle
Zucker
An easier way to automatically calculate the size of AAR in apk based on APP module
Stars: ✭ 76 (+442.86%)
Mutual labels:  gradle
spark-gradle-template
Apache Spark in your IDE with gradle
Stars: ✭ 39 (+178.57%)
Mutual labels:  gradle
gradle-jenkins-jobdsl-plugin
A plugin for Gradle to manage Jenkins Job DSL projects.
Stars: ✭ 48 (+242.86%)
Mutual labels:  gradle
gradle-nunit-plugin
A gradle plugin for launching NUnit tests
Stars: ✭ 17 (+21.43%)
Mutual labels:  gradle

Build Status

swaggerhub-gradle-plugin

A simple gradle plugin to integrate SwaggerHub hosting of OpenAPI/Swagger definitions with a gradle build process, using the SwaggerHub API.

Features

  • Download/upload API definitions from/to SwaggerHub.
  • Supports json and yaml format for API definitions.
  • Authenticate with API key for restricted operations (e.g downloading a private API definition).
  • Connects to SwaggerHub cloud by default or local SwaggerHub instance through optional configuration.

The pattern of usage is likely to depend on whether a code first or design first approach is followed.

Example use cases

Code First

  1. Code API implementation.
  2. Automatically generate API definition from implementation, e.g. via swagger-core annotations and swagger gradle plugin. See also swagger-core wiki
  3. Upload generated API definition to SwaggerHub with swaggerhub-gradle-plugin.

Design First

  1. Write API definition (e.g. in Swagger Editor or SwaggerHub).
  2. Download API definition with swaggerhub-gradle-plugin.
  3. Pass API definition to another Swagger tool e.g.
    • swagger-codegen to generate API client and resource classes.
    • swagger-inflector to automatically wire up the API definition to the implementation and provide out-of-the-box mocking.

Installation

Gradle 2.1 and higher

plugins {
  id "io.swagger.swaggerhub" version "1.0.1"
}

Gradle 1.x and 2.0

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.io.swagger:swaggerhub:1.0.1"
  }
}

apply plugin: "io.swagger.swaggerhub"

Tasks

swaggerhubDownload

Example Usage

  • Download a public API definition in json format from SwaggerHub and save to a local file.
swaggerhubDownload {
    api 'PetStoreAPI'
    owner 'jsfrench'
    version '1.0.0'
    outputFile 'target/test/petStoreAPI.json'
}

Parameters

Parameter Description Required Default
api API name true -
owner API owner true -
version API version true -
outputFile API definition is written to this file true -
token SwaggerHub API key, required to access private definitions false -
format API definition format, json or yaml false json
host URL of SwaggerHub API false api.swaggerhub.com
protocol Protocol for SwaggerHub API,http or https false https
port Port to access SwaggerHub API false 443
oas Version of the OpenApi Specification the definition adheres to false 2.0

swaggerhubUpload

Example Usage

  • Upload an API definition in json format as a public API in SwaggerHub.
swaggerhubUpload {
    api 'PetStoreAPI'
    owner 'jsfrench'
    version '1.0.1-SNAPSHOT'
    inputFile 'target/petStoreAPI.json'
    token  'duMmyAPiKEy'
}

Example Usage together with swagger-gradle-plugin (code first)

  • Upload an API definition in json format (resolved via swagger-gradle-plugin) as a public API in SwaggerHub.

plugins {
    ...
    id 'java'
    id "io.swagger.core.v3.swagger-gradle-plugin" version '2.0.6'
    id "io.swagger.swaggerhub" version "1.0.1"
}

...

resolve {
    outputFileName = 'PetStoreAPI'
    outputFormat = 'JSON'
    prettyPrint = 'TRUE'
    classpath = sourceSets.main.runtimeClasspath
    resourcePackages = ['test.petstore']
    outputPath = 'target'
}

swaggerhubUpload {
    dependsOn resolve
    api 'PetStoreAPI'
    owner 'jsfrench'
    version '1.0.1-SNAPSHOT'
    inputFile 'target/petStoreAPI.json'
    token  'duMmyAPiKEy'
}

Parameters

Parameter Description Required Default
api API name true -
owner API owner true -
version API version true -
inputFile Local file containing the API definition in json or yaml format true -
token SwaggerHub API key true -
format API definition format, json or yaml false json
isPrivate Defines whether the API should be private on SwaggerHub (using true requires a paid plan) false false
host URL of SwaggerHub API false api.swaggerhub.com
protocol Protocol for SwaggerHub API,http or https false https
port Port to access SwaggerHub API false 443
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].