As per http://perfect.org/feature-requests.html
I would like to request that RAML functionality be included out of the box.
I would like to see something like the following on the server for serving RAML documentation:
server.addRamlDocs(path: "/raml.raml", versionRaml: 1.0, versionApi: "v1", title: "Test API title")
This would add a route that when matched creates a full RAML file for all RAML routes.
RAML routes should probably be created in a similar fashion to MustachePageHandler but split into RamlDescriptionHandler, RamlValidateRequestHandler, RamlRequestHandler and RamlResponseHandler.
RamlDescriptionHandler
This should be responsible for:
- Describing the request / response
- Automatically creating documentation for the request (when server docs matched)
RamlValidateRequestHandler
- Validating and type casting the request
This should then inject HTTPRequest.ramlRequestData and HTTPRequest.ramlRequestIsValid. This should require no action from the application developer.
RamlRequestHandler
Application logic to be coded by the developer, should check and use HTTPRequest.ramlRequestData and HTTPRequest.ramlRequestIsValid
Should set HTTPResponse.ramlStatus (HTTP Status Code) and HTTPResponse.ramlData
RamlResponseHandler
Should validate the response and send matching against RamlDescriptionHandler, no action from the application developer.