114 lines
2.2 KiB
YAML
114 lines
2.2 KiB
YAML
info:
|
|
name: Generate an activation label
|
|
type: http
|
|
seq: 2
|
|
|
|
http:
|
|
method: POST
|
|
url: "{{baseUrl}}/nfc/generate"
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"card_id": "1234",
|
|
"override": false
|
|
}
|
|
auth: inherit
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: tests
|
|
code: |-
|
|
test("Should return 200", () => {
|
|
const body = res.getBody()
|
|
expect(res.getStatus()).to.equal(200)
|
|
})
|
|
|
|
test("Body should include the label", () => {
|
|
const body = res.getBody()
|
|
expect(body.label).to.be.defined()
|
|
)}
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
examples:
|
|
- name: 200 Response
|
|
description: Label generated or reused successfully
|
|
request:
|
|
url: "{{baseUrl}}/nfc/generate"
|
|
method: POST
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"card_id": "",
|
|
"override": false
|
|
}
|
|
response:
|
|
status: 200
|
|
statusText: OK
|
|
headers:
|
|
- name: Content-Type
|
|
value: application/json
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"code": "",
|
|
"label": "",
|
|
"overriden": false,
|
|
"reused": false
|
|
}
|
|
- name: 422 Response
|
|
description: Validation error
|
|
request:
|
|
url: "{{baseUrl}}/nfc/generate"
|
|
method: POST
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"card_id": "",
|
|
"override": false
|
|
}
|
|
response:
|
|
status: 422
|
|
statusText: Unprocessable Entity
|
|
headers:
|
|
- name: Content-Type
|
|
value: application/json
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"error": {
|
|
"msg": "",
|
|
"field": ""
|
|
}
|
|
}
|
|
- name: 500 Response
|
|
description: Internal server error
|
|
request:
|
|
url: "{{baseUrl}}/nfc/generate"
|
|
method: POST
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"card_id": "",
|
|
"override": false
|
|
}
|
|
response:
|
|
status: 500
|
|
statusText: Internal Server Error
|
|
body:
|
|
type: text
|
|
data: |-
|
|
{
|
|
"error": ""
|
|
}
|