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:

  1. Import play keys
    import play.PlayImport.PlayKeys._
  2. Enable plugin
    enablePlugins(PlayScala)
  3. 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