OpenApi generators for Scala.
Here is a small video demo: https://youtu.be/kf0vGrlKNb8
- incremental generator
- doesn't touch the code that you added manually
- only adds new properties/methods/classes
- lenient parser+generator
- if something is not supported it will still (mostly) work
- you can adapt your openapi spec to work gradually
- JSON only
- only named entities, no anonymous objects
Supports almost all features:
- controllers
- discriminated models (sealed traits)
- enums (scala3 singleton enums)
- validations
- query params
Supports some features:
- routes (controllers)
- discriminated models (sealed traits)
- enums (scala3 singleton enums)
TODO: query params, validation..
Contributions welcome!
See https://github.com/sake92/mill-openapi4s
You can use openapi4s-cli
with Coursier launcher to generate your sources:
cs launch ba.sake::openapi4s-cli:0.6.1 -M ba.sake.openapi4s.cli.OpenApi4sMain -- \
--generator sharaf \
--url openapi.json \
--baseFolder src \
--basePackage com.example