docs: Add example YAML files
- examples/custom.yaml: Custom YAML format example - examples/postman.yaml: Postman Collection v2.1 example - examples/openapi.yaml: OpenAPI 3.0 example
This commit is contained in:
1 parent
bf47218831
commit
2250961d09
3 files changed
+150
No files matched your search
@@ -0,0 +1,52 @@
|
||||
info:
|
||||
name: "Test Collection"
|
||||
schema: "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||
|
||||
variable:
|
||||
- key: base_url
|
||||
value: http://localhost:8080
|
||||
- key: email
|
||||
value: test@example.com
|
||||
|
||||
item:
|
||||
- name: "Login"
|
||||
request:
|
||||
method: POST
|
||||
url:
|
||||
raw: "{{base_url}}/api/login"
|
||||
host:
|
||||
- "{{base_url}}"
|
||||
path:
|
||||
- api
|
||||
- login
|
||||
header:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
body:
|
||||
mode: raw
|
||||
raw: '{"email": "{{email}}", "password": "Test123!"}'
|
||||
event:
|
||||
- listen: test
|
||||
script:
|
||||
exec:
|
||||
- "pm.test('status is 200', function() { pm.response.to.have.status(200); });"
|
||||
- "pm.environment.set('token', pm.response.json().token);"
|
||||
|
||||
- name: "Get Profile"
|
||||
request:
|
||||
method: GET
|
||||
url:
|
||||
raw: "{{base_url}}/api/profile"
|
||||
host:
|
||||
- "{{base_url}}"
|
||||
path:
|
||||
- api
|
||||
- profile
|
||||
header:
|
||||
- key: Authorization
|
||||
value: "Bearer {{token}}"
|
||||
event:
|
||||
- listen: test
|
||||
script:
|
||||
exec:
|
||||
- "pm.test('status is 200', function() { pm.response.to.have.status(200); });"
|
||||
Reference in new issue
Block a user