This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support Headers definition #19
- Loading branch information
Showing
4 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "e73be420-bb04-4dd6-bc29-296a80feec7c", | ||
"name": "Headers", | ||
"description": "API with headers", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Get list of users", | ||
"request": { | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "X-My-Header", | ||
"value": "hudjilksns78jsijns090", | ||
"description": "Custom header", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "X-Other", | ||
"value": "other", | ||
"description": "Another header", | ||
"type": "text" | ||
} | ||
], | ||
"url": { | ||
"raw": "https://api.io/users?name=Jhon&review=true", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"io" | ||
], | ||
"path": [ | ||
"users" | ||
], | ||
"query": [ | ||
{ | ||
"key": "age", | ||
"value": "45", | ||
"description": "Filter by age", | ||
"disabled": true | ||
}, | ||
{ | ||
"key": "name", | ||
"value": "Jhon", | ||
"description": "Filter by name" | ||
}, | ||
{ | ||
"key": "review", | ||
"value": "true", | ||
"description": "Indicate if should be reviewed or not" | ||
} | ||
] | ||
}, | ||
"description": "Obtain a list of users that fullfill the conditions of the filters" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Create new User", | ||
"request": { | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/json", | ||
"description": "Indicate the type of body sent by client", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "X-My-Header", | ||
"value": "hudjilksns78jsijns090", | ||
"description": "Custom header", | ||
"type": "text" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"example\": \"field\",\n \"other\": {\n \"data1\": \"yes\",\n \"data2\": \"no\"\n }\n}", | ||
"options": { | ||
"raw": { | ||
"language": "json" | ||
} | ||
} | ||
}, | ||
"url": { | ||
"raw": "https://api.io/users", | ||
"protocol": "https", | ||
"host": [ | ||
"api", | ||
"io" | ||
], | ||
"path": [ | ||
"users" | ||
] | ||
}, | ||
"description": "Create a new user into your amazing API" | ||
}, | ||
"response": [] | ||
} | ||
], | ||
"event": [ | ||
{ | ||
"listen": "prerequest", | ||
"script": { | ||
"id": "442a1ec6-72b9-416f-abb3-d2477ca14c0e", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
}, | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "127cb01a-be4f-4a62-97f9-d779d318a9a1", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"protocolProfileBehavior": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Headers | ||
description: API with headers | ||
version: 1.0.0 | ||
paths: | ||
/users: | ||
get: | ||
tags: | ||
- default | ||
summary: Get list of users | ||
description: Obtain a list of users that fullfill the conditions of the filters | ||
parameters: | ||
- name: X-My-Header | ||
in: header | ||
schema: | ||
type: string | ||
description: Custom header | ||
- name: X-Other | ||
in: header | ||
schema: | ||
type: string | ||
description: Another header | ||
- name: age | ||
in: query | ||
schema: | ||
type: string | ||
description: Filter by age | ||
- name: name | ||
in: query | ||
schema: | ||
type: string | ||
description: Filter by name | ||
- name: review | ||
in: query | ||
schema: | ||
type: string | ||
description: Indicate if should be reviewed or not | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: {} | ||
post: | ||
tags: | ||
- default | ||
summary: Create new User | ||
description: Create a new user into your amazing API | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
example: | ||
example: field | ||
other: | ||
data1: 'yes' | ||
data2: 'no' | ||
parameters: | ||
- name: Content-Type | ||
in: header | ||
schema: | ||
type: string | ||
description: Indicate the type of body sent by client | ||
- name: X-My-Header | ||
in: header | ||
schema: | ||
type: string | ||
description: Custom header | ||
responses: | ||
'200': | ||
description: Successful response | ||
content: | ||
application/json: {} |