https://github.com/yonatankarp/openapi-usage-example
An example of how to use OpenAPI, SpringBoot, Gradle and Kotlin to build RESTful API as described in https://yonatankarp.com/how-to-write-robust-rest-api-with-openapi
https://github.com/yonatankarp/openapi-usage-example
gradle kotlin openapi
Last synced: 22 days ago
JSON representation
An example of how to use OpenAPI, SpringBoot, Gradle and Kotlin to build RESTful API as described in https://yonatankarp.com/how-to-write-robust-rest-api-with-openapi
- Host: GitHub
- URL: https://github.com/yonatankarp/openapi-usage-example
- Owner: yonatankarp
- Created: 2021-12-15T14:29:00.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-29T01:03:59.000Z (about 1 month ago)
- Last Synced: 2025-12-31T19:37:36.581Z (about 1 month ago)
- Topics: gradle, kotlin, openapi
- Language: Kotlin
- Homepage:
- Size: 523 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/codeowners
Awesome Lists containing this project
README
# OpenApi Usage Example
This repository contains the codebase that was used in the article
[How to Write a Robust REST API with OpenAPI](https://yonatankarp.com/blog/how-to-write-a-robust-rest-api-with-openapi) in the blog
[yonatankarp.com](https://yonatankarp.com).
## How to run
To build the project using Gradle run the following command in the project
root directory:
```shell
$ ./gradlew build
```
Once the project was successfully build, run the service with the following
command:
```shell
$ ./gradlew bootRun
```
When the service runs, you can call it with the following example:
```shell
$ curl "http://localhost:8080/v1/greet?name=Yonatan"
```
Response example:
```json
{"greet":"Hello, yonatan!"}
```
## Built With
- [OpenJdk 17](https://openjdk.java.net/projects/jdk/17/)
- [Kotlin](https://kotlinlang.org/)
- [OpenAPI](https://www.openapis.org/) - API Spec
- [SpringBoot 3.x.x](https://spring.io/projects/spring-boot) - The web framework used
- [Gradle Kotlin DSL](https://gradle.org/) - Dependency Management
## Authors
- **Yonatan Karp-Rudin** - *Initial work* - [yonatankarp](https://github.com/yonatankarp)