forked from vtrifonov/http-api-mock
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusers-storage-post.json
23 lines (23 loc) · 932 Bytes
/
users-storage-post.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"description": "Stores a user by passing username and fullname in the body generating id for that user. e.g. Request Body: username=storageUser&fullname=Storage User",
"request": {
"method": "POST",
"path": "/storage-users"
},
"persist": {
"entity-id": "{{ storage.SetValue({{ request.body.username\\=(?P<value>.+?)(?:&|$) }}, {{ storage.Sequence(storage-users, 1) }}) }}",
"entity": "/storage-users/user-{{ persist.entity.id }}.json",
"actions" : {
"write" : "{\"id\":{{ persist.entity.id }}, \"username\": \"{{ request.body.username\\=(?P<value>.+?)(?:&|$) }}\", \"fullname\":\"{{ request.body.fullname\\=(?P<value>.+?)(?:&|$) }}\"}"
}
},
"response": {
"statusCode": 202,
"headers": {
"Content-Type": [
"application/json"
]
},
"body":"{{ persist.entity.content }}"
}
}