Skip to content

Instantly share code, notes, and snippets.

@sebastianhenneberg
Created January 22, 2016 16:28
Show Gist options
  • Save sebastianhenneberg/fd3088e37e402b07aa92 to your computer and use it in GitHub Desktop.
Save sebastianhenneberg/fd3088e37e402b07aa92 to your computer and use it in GitHub Desktop.
Example API with RAML Step 7
# document root and types
traits:
BadRequest:
responses:
400:
description: Required properties missing or validation issues.
body:
type: Error
resourceTypes:
NotFound:
put:
responses:
404:
description: Unkown <<resourcePathName>>.
body:
type: Error
/users:
# get operation
post:
description: Create new user.
is: BadRequest
body:
type: UserBase
responses:
201:
description: New user created successful.
/{userId}:
type: NotFound
uriParameters:
userId: integer
put:
description: Update user.
is: BadRequest
body:
type: UserBase
responses:
200:
description: User updated successful.
body:
type: User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment