To simplify the versioning of routes, akwatype allows to define a new route by inheriting a previous version

A previous route can be inherited by the amend or override keywords

  • route search_v2 amend search
  • route search_v2 override search

amend allows  :

  • To declare that you want to create a route from another one
  • To overload or add elements to the existing description

In this example, search_v2 redefines the search route with modification of the url and request.
All the other properties remain unchanged.

service Job{
    url:"job"
    expose jobs{
        url:"jobs"
route search{ url:"search" method: POST request: JobSearchDTO response: [JobOfferDTO] consume Disponibility.jobs.get }
route search_v2 amend search{ url: "v2/search" request: JobAdvancedSearchDTO } } }

 

override allows  :

  • To declare that you want to create a route from another one
  • To completely redefine the route
  • This option is useful to keep the link between the different versions of the same route even if it is completely redefined