Skip to content

Instantly share code, notes, and snippets.

@crizstian
Last active February 17, 2018 11:36
Show Gist options
  • Save crizstian/b57011779b41d16f0cbbc8ec306e40af to your computer and use it in GitHub Desktop.
Save crizstian/b57011779b41d16f0cbbc8ec306e40af to your computer and use it in GitHub Desktop.
Example of a raml file
#%RAML 1.0
title: Booking Service
version: v1
baseUri: /
types:
Booking:
properties:
city: string
cinema: string
movie: string
schedule: datetime
cinemaRoom: string
seats: array
totalAmount: number
User:
properties:
name: string
lastname: string
email: string
creditcard: object
phoneNumber?: string
membership?: number
Ticket:
properties:
cinema: string
schedule: string
movie: string
seat: string
cinemaRoom: string
orderId: string
resourceTypes:
GET:
get:
responses:
200:
body:
application/json:
type: <<item>>
POST:
post:
body:
application/json:
type: <<item>>
type: <<item2>>
responses:
201:
body:
application/json:
type: <<item3>>
/booking:
type: { POST: {item : Booking, item2 : User, item3: Ticket} }
description: The booking service need a Booking object that contains all
the needed information to make a purchase of cinema tickets.
Needs a user information to make the booking succesfully.
And returns a ticket object.
/verify/{orderId}:
type: { GET: {item : Ticket} }
description: This route is for verify orders, and would return all the details
of a specific purchased by orderid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment