In its simplest syntax Akwatype allows to define the facade of request by using the request property followed by the name of the facade (CustomerDTO in the example below).

service _Customer{
    url:"customer"
    expose customer{
        url:"customers"
        route updateCustomer{
method: POST
label:"customer update"
url:"customer/id:String" request:CustomerDTO } } }

 

For more advanced use cases, you can use the  request: { ... } property.

request is followed by:

  • A valid type or facade name 
  • property block between { }

service _Customer{
    url:"customer"
    expose customers{
        url:"customers"
        route detail{
            method: POST
label:"customer update" url:"customer/id:String" request: CustomerDTO { description:"request with CustomerDTO Facade"
example:xCustomerACME
required:true } } } }

 

Request properties in request block :

  • description (String)
    • description of the request
  • mediaType(String)
    • format of the request ("application/json","application/xml",...)
    • optional default "application/json"
  • required(Boolean)
    • is the request required ?
    • optional default false
  • example (String)
    • if the request is a facade, name of an example on this type or facade
    • if the request is a scalar (String, Integer ...), example value of the type of the request("My response", 45, ...)
  • examples (map of examples)
    • key : String
    • value :
      • if the request is a facade, name of an example on this type or facade
      • if the request is a scalar (String, Integer ...), example value of the type of the response ("My response", 45, ...)