myAPIz relevant Smithy files and language dependent libraries that give you the recommended way to build your APIs.
Currently supported languages:
- Scala
- Install SBT (Scala Build Tool)
- Install Smithy CLI
smithy validate
sbt package
This will generate a model.jar target folder which contains the smithy model and then can be included and referenced in your API implementations.
In your api.smithy
file, you can reference the model like this:
use smithy.api#required
use alloy#simpleRestJson
use com.myapiz.smithy.error#NotFoundError
use com.myapiz.smithy.error#NotAuthenticatedError
use com.myapiz.smithy.error#NotAuthorizedError
use com.myapiz.smithy.auth#authorization
The Smithy model can be used to generate Scala implementations for your APIs.
Directly use the Scala implementations in your code:
// add the smithy plugin to your build.sbt
.enablePlugins(Smithy4sCodegenPlugin)
// add the dependencies to your build.sbt
"com.myapiz" % "smithy4s_3" % versions.myapiz,
For a quick start, see the smithy4s-project project template.
This project is licensed under the Apache-2.0 License.