An open API service indexing awesome lists of open source software.

https://github.com/sake92/openapi4s-demo


https://github.com/sake92/openapi4s-demo

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# openapi4s-demo

Petstore [spec](api/resources/openapi.json) is downloaded on 26.12.2024 from https://petstore3.swagger.io/api/v3/openapi.json

Here is a video demo: https://youtu.be/kf0vGrlKNb8

## Usage
```shell
# 1. update the openapi.json

# 2. (re)generate
./mill api.openApi4sGenerate

# 3. see what changed
git diff

# 4. fill in the details
./mill api.compile

# 5. git commit
```

By default, all endpoints will return 501 NotImplemented status.
You just need to fill in the details. :)

OpenApi4s will only overwrite definitions that it wrote originally (not the expressions though!).
Any class/method/val generated by OpenApi4s can be overwritten if you change it manually!
Other code (e.g. business logic in controller), *that you wrote* will not be touched. :)

## Swagger UI

Access it at http://localhost:8080/swagger

## CI check

There is a small chance that OpenApi4s overwrites your changes.
To prevent that, there is a [small CI script](./.github/workflows/ci.yml) that checks this.
It *forcefully regenerates the files*, and makes sure there is no `git diff` changes after that.
This way you can be sure that your changes are preserved correctly.