Skip to content

Instantly share code, notes, and snippets.

@crizstian
Last active January 29, 2017 22:02
Show Gist options
  • Save crizstian/6f41b2423e077b779a94776022917f5a to your computer and use it in GitHub Desktop.
Save crizstian/6f41b2423e077b779a94776022917f5a to your computer and use it in GitHub Desktop.
Cinema Catalog Service API example
#%RAML 1.0
title: Cinema Catalog Service
version: v1
baseUri: /
uses:
object: types.raml
stack: ../movies-service/api.raml
types:
Cinemas: object.Cinema []
Movies: stack.MoviePremieres
Schedules: object.Schedule []
traits:
FilterByLocation:
queryParameters:
city:
type: string
resourceTypes:
GET:
get:
responses:
200:
body:
application/json:
type: <<item>>
/cinemas:
type: { GET: {item : Cinemas } }
get:
is: [FilterByLocation]
description: we already have the location defined to display the cinemas
/cinemas/{cinema_id}:
type: { GET: {item : Movies } }
description: we have selected the cinema to display the movie premieres
/cinemas/{cinema_id}/{movie_id}:
type: { GET: {item : Schedules } }
description: we have selceted a movie to display the schedules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment