-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.raml
41 lines (41 loc) · 1.57 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#%RAML 0.8
baseUri: http://mocksvc.mulesoft.com/mocks/f9c19cd6-2601-4c84-bd5c-8435fb4430f6
title: Modeling Collections
documentation:
- title: Example of how to model a CRUD API of collections and members
content: |
By defining resources, schemas and resourceTypes with appropriate names,
you can model an API for any hierarchy of resource collections
and members very succinctly and consistently.
mediaType: application/json
schemas: !include schemas/collection-schemas.raml
resourceTypes: !include patterns/resourceTypes/collection-types.raml
traits: !include patterns/traits/collection-traits.raml
/users:
type:
collection:
example-collection: !include example-users.json
example-member: !include example-user.json
example-newmember: !include example-newuser.json
# example-member-id: gi68q2id6g
/{userId}:
type:
member:
example-member: !include example-user.json
example-newmember: !include example-newuser.json
example-partialmember: !include example-partialuser.json
/books:
is: [ accountable ]
type:
collection:
example-collection: !include example-books.json
example-member: !include example-book.json
example-newmember: !include example-newbook.json
# example-member-id: 123
/{bookId}:
is: [ accountable ]
type:
member:
example-member: !include example-book.json
example-newmember: !include example-newbook.json
example-partialmember: !include example-partialbook.json