Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Define RAML properties to allow runing Ra tests #36

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
235d9fe
Define response for /stories
postatum Jun 8, 2015
4d882a8
Merge branch '99129800_ramlfications' into 95470296_generate_tests
postatum Jul 21, 2015
9ef8347
Merge branch 'develop' into 95470296_generate_tests
postatum Jul 21, 2015
20f405a
Merge branch 'develop' into 95470296_generate_tests
postatum Jul 23, 2015
f8fc3cb
Add Ra tests runner file
postatum Jul 23, 2015
15fa561
Use new api of Ra
postatum Jul 23, 2015
6bf0244
Define correct baseUri
postatum Jul 23, 2015
925d109
Add Content-Length header to /stories
postatum Jul 24, 2015
59b1f1e
Add query params definition
postatum Jul 24, 2015
d789aed
Define schemas for POST
postatum Jul 27, 2015
7ebb6c3
Add stories PATCH definitions
postatum Jul 27, 2015
52cba8f
Define schema for collection level actions
postatum Jul 28, 2015
d6d19d2
Define HEAD/OPTIONS headers
postatum Jul 28, 2015
bf96bcc
Rename schemas. Add DELETE setup
postatum Jul 28, 2015
66ee98d
Define non-DB schemas using draft04 of json schema
postatum Jul 28, 2015
4bd1d0b
Define uri param for stories
postatum Jul 29, 2015
8e0c881
Define stories/id raml
postatum Jul 29, 2015
70d8b08
Refactor out RAML parts to yaml
postatum Jul 29, 2015
7df5727
Define schemas for all resources
postatum Jul 29, 2015
a423cf8
Add schemas to stories PUT, user PUT. Remove fields from user body ex…
postatum Jul 31, 2015
26ba950
Fix profile body example tab
postatum Jul 31, 2015
0ff8315
Fix required fields in schemas
postatum Jul 31, 2015
f2e3085
Merge branch 'develop' of github.com:brandicted/ramses-example into 9…
postatum Jul 31, 2015
dcf8489
Remove id definition in user schemas
postatum Jul 31, 2015
662f972
Merge branch 'develop' into 95470296_generate_tests
postatum Aug 18, 2015
aa4c30e
Merge branch 'develop' of github.com:brandicted/ramses-example into 9…
postatum Aug 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 246 additions & 44 deletions example.raml
Original file line number Diff line number Diff line change
Expand Up @@ -5,127 +5,329 @@ documentation:
- title: Home
content: |
Welcome to the example API.
baseUri: http://{host}:{port}/{version}
baseUri: http://localhost:6543/api
version: v1
mediaType: application/json
protocols: [HTTP, HTTPS]
securitySchemes:
- x_token_auth:
description: Authorization header token policy
type: x-ApiKey
- x_ticket_auth:
description: Standard Pyramid Auth Ticket policy
type: x-Ticket
settings:
secret: auth_tkt_secret
hashalg: sha512
cookie_name: ramses_auth_tkt
http_only: true
- read_only_users:
description: ACL that allows authenticated users to read collection
type: x-ACL
settings:
collection: |
allow admin all
allow authenticated get
item: |
allow admin all
allow authenticated get
- read_only_useritem_everyone:
description: ACL that allows everyone to read item, authenticated users to read collection
type: x-ACL
settings:
collection: |
allow admin all
allow authenticated get
item: |
allow admin all
allow everyone get
allow {{user_self}} patch
securitySchemes: !include inclusions/yaml/security_schemes.yaml
securedBy: [x_ticket_auth]

/stories:
securedBy: [read_only_users]
displayName: All stories
get:
description: Get all stories
queryParameters: !include inclusions/yaml/collection_query_params.yaml
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/collection_response.json
headers: !include inclusions/yaml/demo_headers.yaml
post:
description: Create a new story
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
schema: !include schemas/story.json
schema: !include inclusions/schemas/story.json
example: !include inclusions/examples/story_body_example.json
responses:
201:
body:
application/json:
schema: !include inclusions/schemas/story_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
patch:
description: Update multiple stories
delete:
description: Delete multiple stories
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
_limit:
displayName: Limit
type: integer
required: true
example: 5
body:
application/json:
example: !include inclusions/examples/story_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/collection_patch_response.json
headers: !include inclusions/yaml/demo_headers.yaml
head:
description: Determine whether a given resource is available
queryParameters: !include inclusions/yaml/collection_query_params.yaml
responses:
200:
headers: !include inclusions/yaml/demo_headers.yaml
options:
description: Retrieve the available HTTP verbs for a given resource

responses: !include inclusions/yaml/options_responses.yaml
delete:
description: Delete multiple stories
queryParameters:
q:
displayName: Query
type: string
required: false
example: foobar
minLength: 1
_limit:
displayName: Limit
type: integer
required: true
minimum: 1
example: 10
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/collection_delete_response.json
headers: !include inclusions/yaml/demo_headers.yaml
/{id}:
displayName: One story
uriParameters:
id:
displayName: StoryID
type: integer
get:
description: Get a particular story
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/story_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
delete:
description: Delete a particular story
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/item_delete_response.json
headers: !include inclusions/yaml/demo_headers.yaml
patch:
put:
description: Update a particular story
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
example: !include inclusions/examples/story_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/story_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
put:
description: Replace a particular story
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
schema: !include inclusions/schemas/story.json
example: !include inclusions/examples/story_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/story_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
head:
description: Determine whether a given resource is available
responses:
200:
headers: !include inclusions/yaml/demo_headers.yaml
options:
description: Retrieve the available HTTP verbs for a given resource
responses: !include inclusions/yaml/options_responses.yaml

/users:
securedBy: [read_only_useritem_everyone]
displayName: All users
get:
description: Get all users
queryParameters: !include inclusions/yaml/collection_query_params.yaml
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/collection_response.json
headers: !include inclusions/yaml/demo_headers.yaml
post:
description: Create a new user
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
schema: !include schemas/user.json
schema: !include inclusions/schemas/user.json
example: !include inclusions/examples/user_body_example.json
responses:
201:
body:
application/json:
schema: !include inclusions/schemas/user_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
patch:
description: Update multiple users
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
_limit:
displayName: Limit
type: integer
required: true
example: 5
body:
application/json:
example: !include inclusions/examples/user_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/collection_patch_response.json
headers: !include inclusions/yaml/demo_headers.yaml
head:
description: Determine whether a given resource is available
queryParameters: !include inclusions/yaml/collection_query_params.yaml
responses:
200:
headers: !include inclusions/yaml/demo_headers.yaml
options:
description: Retrieve the available HTTP verbs for a given resource
responses: !include inclusions/yaml/options_responses.yaml

/{username}:
displayName: One user
uriParameters:
id:
displayName: Username
type: string
get:
description: Get a particular user
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/user_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
patch:
put:
description: Update a particular user
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
example: !include inclusions/examples/user_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/user_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
put:
description: Replace a particular user
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
schema: !include inclusions/schemas/user.json
example: !include inclusions/examples/user_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/user_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
delete:
description: Delete a particular user

queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/item_delete_response.json
headers: !include inclusions/yaml/demo_headers.yaml
/settings:
displayName: User settings
get:
description: Get all settings of a particular user
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/settings_response.json
headers: !include inclusions/yaml/demo_headers.yaml
post:
description: Change a user's settings

queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
example: !include inclusions/examples/settings_body_example.json
responses:
201:
body:
application/json:
schema: !include inclusions/schemas/settings_response.json
headers: !include inclusions/yaml/demo_headers.yaml
/groups:
displayName: User groups
get:
description: Get all groups of a particular user
responses:
200:
headers: !include inclusions/yaml/demo_headers.yaml
post:
description: Change a user's groups
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
example: !include inclusions/examples/groups_body_example.json
responses:
201:
headers: !include inclusions/yaml/demo_headers.yaml

/profile:
displayName: User profile
get:
description: Get a user's profile
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/profile_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
post:
description: Create a user's profile
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
schema: !include schemas/profile.json
schema: !include inclusions/schemas/profile.json
example: !include inclusions/examples/profile_body_example.json
responses:
201:
body:
application/json:
schema: !include inclusions/schemas/profile_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml

patch:
description: Update a user's profile
queryParameters:
_refresh_index: !include inclusions/yaml/refresh_index_param.yaml
body:
application/json:
example: !include inclusions/examples/profile_body_example.json
responses:
200:
body:
application/json:
schema: !include inclusions/schemas/profile_item_response.json
headers: !include inclusions/yaml/demo_headers.yaml
1 change: 1 addition & 0 deletions inclusions/examples/groups_body_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"user": "bar", "admin": "foo"}
1 change: 1 addition & 0 deletions inclusions/examples/profile_body_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address": "Earth, Milky Way"}
1 change: 1 addition & 0 deletions inclusions/examples/settings_body_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"foo": "bar"}
Loading