Play Routes File
Guarantee your Play Framework service implements every endpoint. API Builder generates a routes file that validates completeness at compile time.
⏱ Bindables for Date Times
Generated clients include a Bindables object with implicits
to automatically bind date-iso8601 and date-time-iso8601 data types in routes.
✦ Enums as First Class in Routes
Enums are first-class objects in routes. When a path or parameter includes an enumeration, Play automatically validates the value and returns an error page listing valid types if the value is invalid. To enable this, add the appropriate imports:
- Import play keys —
import play.PlayImport.PlayKeys._ - Enable plugin —
enablePlugins(PlayScala) - Add bindables to build.sbt —
routesImport += "<packageName>.<serviceName>.v<versionNumber>.Bindables._"For example:
routesImport += "io.apibuilder.api.v0.Bindables._"
For a working example, see API Builder's build.sbt file.
Explore all available code generators
View Generators