Code Monkey home page Code Monkey logo

khs-spring-boot-publish-swagger-starter's Introduction

khs-spring-boot-publish-swagger-starter

A Spring Boot starter for publishing Swagger API on startup.

Description

This Spring Boot starter can be used to POST Swagger JSON to a publishing target (url) upon startup of the Spring Boot application. The body of the request will be the raw Swagger JSON, and a security token can be applied to ensure that only authorized clients have access.

Usage

Add this dependency to your pom.xml:

<dependency>
	<groupId>com.keyholesoftware</groupId>
	<artifactId>khs-spring-boot-publish-swagger-starter</artifactId>
	<version>1.0.0</version>
</dependency>	

Annotate your Spring Boot main class:

@SpringBootApplication
@PublishSwagger
public class MySpringBootApp {

	public static void main(String[] args) {
		SpringApplication.run(MySpringBootApp.class, args);
	}
}

Configurable Properties:

swagger.publish.publish-url - Where to publish the Swagger API (will be called with a POST verb)
swagger.publish.security-token: An optional security token -- will be sent as a "token" header
swagger.publish.swagger-url - The URL that supplies the swagger API, will usually be served from the 
app itself (see examples below)

Example Configuration(s):

(i.e. application.yml)

Publish from running Swagger doc API

swagger:
  publish:
    publish-url: http://beta.grokola.com/swagger/publish/1027
    security-token: 9a019713-XXXX-XXXX-XXXX-74090a0ea9f7
    swagger-url: http://127.0.0.1:${server.port}/v2/api-docs

Publish from Swagger JSON file

swagger:
  publish:
    publish-url: http://beta.grokola.com/swagger/publish/1027
    security-token: 9a019713-XXXX-XXXX-XXXX-74090a0ea9f7
    swagger-url: http://127.0.0.1:${server.port}/swagger.json	   

khs-spring-boot-publish-swagger-starter's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.