API Builder generates a play routes file to help ensure that a service written using the Play Framework actually implements all of the methods defined by the API.
Within Play, their are a few features we take advantage for type safety of routes:
Within the generated clients, you will find an object Bindables
that contains implicits to automatically
date-time-iso8601 data types.
enums are represented as first class objects in routes. In order to use this feature, you must use the appropriate imports. This means that if you declare a route in play where the path or a parameter includes an enumeration, we will automatically be able to validate that the value provided is actually appropriate for the enumeration. If the value provided is NOT a valid type, play will return an error page listing the appropriate types.
routesImport += "<packageName>.<serviceName>.v<versionNumber>.Bindables._"for example:
routesImport += "io.apibuilder.api.v0.Bindables._"
For a real life example, view API Builder's build.sbt file