vincentlowe

American Flights RAML (model)

Jan 15th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.83 KB | None | 0 0
  1. #%RAML 1.0
  2. version: v1
  3. title: American Flights API
  4.  
  5. types:
  6.   AmericanFlight: !include exchange_modules/68ef9520-24e9-4cf2-b2f5-620025690913/training-american-flight-data-type/1.0.1/AmericanFlightDataType.raml
  7.  
  8. /flights:
  9.   description: a flight record from the American database
  10.   get:
  11.     description: get all flight records
  12.     queryParameters:
  13.       destination:
  14.         required: false
  15.         enum:
  16.          - SFO
  17.           - LAX
  18.           - CLE
  19.     responses:
  20.       200:
  21.         body:
  22.           application/json:
  23.             type: AmericanFlight[]
  24.             example: !include exchange_modules/68ef9520-24e9-4cf2-b2f5-620025690913/training-american-flights-example/1.0.1/AmericanFlightsExample.raml            
  25.  
  26.   post:
  27.     description: add a flight record
  28.     body:
  29.       application/json:
  30.         example: !include examples/AmericanFlightsNoIDExample.raml
  31.     responses:
  32.       201:
  33.         body:
  34.           application/json:
  35.             example:
  36.               responsemesssage: Flight record added (honest joe, it's in there)
  37.  
  38.   /{ID}:
  39.     description: one flight record matching ID
  40.     get:
  41.       description: return one flight with record number equal ID
  42.       responses:
  43.         200:
  44.           body:
  45.             application/json:
  46.               type: AmericanFlight
  47.               example: !include examples/AmericanFlightExample.raml
  48.     delete:
  49.       responses:
  50.         200:
  51.           body:
  52.             application/json:
  53.               example:
  54.                 message: Flight deleted (but not really)
  55.     put:
  56.       body:
  57.         application/json:
  58.           type: AmericanFlight
  59.           example: !include examples/AmericanFlightsNoIDExample.raml
  60.       responses:
  61.         200:
  62.           body:
  63.             application/json:
  64.               example:
  65.                 message: Flight updated (but not really)
Advertisement
Add Comment
Please, Sign In to add comment