Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slamdev/openapi-spring-generator
OpenAPI Generator for Java Spring framework
https://github.com/slamdev/openapi-spring-generator
gradle-plugin openapi spring
Last synced: 27 days ago
JSON representation
OpenAPI Generator for Java Spring framework
- Host: GitHub
- URL: https://github.com/slamdev/openapi-spring-generator
- Owner: slamdev
- License: apache-2.0
- Created: 2020-11-07T11:14:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-22T11:55:25.000Z (10 months ago)
- Last Synced: 2024-02-22T12:33:31.753Z (10 months ago)
- Topics: gradle-plugin, openapi, spring
- Language: Java
- Homepage:
- Size: 213 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openapi-spring-generator
OpenAPI Generator for Java Spring framework
[![Build Actions Status](https://github.com/slamdev/openapi-spring-generator/workflows/build/badge.svg)](https://github.com/slamdev/openapi-spring-generator/actions)
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/com/github/slamdev/openapi-spring-generator/com.github.slamdev.openapi-spring-generator.gradle.plugin/maven-metadata.xml.svg?colorB=007ec6&label=gradle%20plugin)](https://plugins.gradle.org/plugin/com.github.slamdev.openapi-spring-generator)## Motivation
In a microservice world you need to provide a communication layer between your services. Doesnt matter you go with sync
(HTTP) or async (PubSub) way, you need to maintain a contract between two sides.This plugin generates code for DTOs as well as interfaces\services for HTTP client\server and PubSub consumer\producer
based on the OpenApi v2\v3 spec file.Whenever the spec file is changed, generated code is changed as well, thus allowing you to catch and contract
incompatibilities in the runtime.## Usage
First step is to add the plugin to your project as described [here](https://plugins.gradle.org/plugin/com.github.slamdev.openapi-spring-generator).
Next step is to write specification of you API in [Swagger/OpenAPI](http://swagger.io/) yaml format. [Swagger editor](http://editor.swagger.io/)
is really helpful for this task.## Make a release
```shell script
TAG=x.x.x && git tag -a ${TAG} -m "make ${TAG} release" && git push --tags
```