mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-02-26 08:29:12 +00:00
* Extract response examples * Add response examples to spec * Generate Postman samples * Test samples
616 lines
15 KiB
JSON
616 lines
15 KiB
JSON
{
|
|
"info": {
|
|
"name": "Sample project",
|
|
"description": {
|
|
"content": "Sample API Check \"API Key\" ",
|
|
"type": "text/markdown"
|
|
},
|
|
"version": "1.0",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "default",
|
|
"item": [
|
|
{
|
|
"name": "/users/:userId (DEPRECATED)",
|
|
"description": "Update the information of an existing user.",
|
|
"item": [
|
|
{
|
|
"name": "Example patch user",
|
|
"request": {
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode",
|
|
"value": "code_one",
|
|
"description": "Code as header",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode2",
|
|
"value": "",
|
|
"description": "Code as header2",
|
|
"disabled": true
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\" : \"John\",\n \"tags\" : [ \"user\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/:userId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users",
|
|
":userId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "userId",
|
|
"value": "",
|
|
"description": "Id of an existing user."
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Update the information of an existing user."
|
|
}
|
|
,"response": [
|
|
{"name": "User Updated",
|
|
"code": 200,
|
|
"status": "OK",
|
|
"header": [{
|
|
"key": "Content-Type",
|
|
"value": "application/json"}
|
|
],
|
|
"_postman_previewlanguage": "json",
|
|
"cookie": [],
|
|
"body" : "{\n \"id\" : 1,\n \"firstName\" : \"Ron\",\n \"lastName\" : \"Edwardz\",\n \"email\" : \"ron.edwardz@example.com\",\n \"dateOfBirth\" : \"1980-10-31\",\n \"emailVerified\" : true,\n \"tags\" : [ \"admin\" ]\n}",
|
|
"originalRequest": {
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode",
|
|
"value": "code_one",
|
|
"description": "Code as header",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode2",
|
|
"value": "",
|
|
"description": "Code as header2",
|
|
"disabled": true
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\" : \"John\",\n \"tags\" : [ \"user\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/:userId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users",
|
|
":userId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "userId",
|
|
"value": "",
|
|
"description": "Id of an existing user."
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Update the information of an existing user."
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Example patch another user",
|
|
"request": {
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode",
|
|
"value": "code_one",
|
|
"description": "Code as header",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode2",
|
|
"value": "",
|
|
"description": "Code as header2",
|
|
"disabled": true
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\" : \"Bill\",\n \"tags\" : [ \"admin\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/:userId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users",
|
|
":userId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "userId",
|
|
"value": "",
|
|
"description": "Id of an existing user."
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Update the information of an existing user."
|
|
}
|
|
,"response": [
|
|
{"name": "User Updated",
|
|
"code": 200,
|
|
"status": "OK",
|
|
"header": [{
|
|
"key": "Content-Type",
|
|
"value": "application/json"}
|
|
],
|
|
"_postman_previewlanguage": "json",
|
|
"cookie": [],
|
|
"body" : "{\n \"id\" : 2,\n \"firstName\" : \"Rik\",\n \"lastName\" : \"Tom\",\n \"email\" : \"rik.tom@example.com\",\n \"dateOfBirth\" : \"1981-10-11\",\n \"emailVerified\" : true,\n \"tags\" : [ \"guest\" ]\n}",
|
|
"originalRequest": {
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode",
|
|
"value": "code_one",
|
|
"description": "Code as header",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode2",
|
|
"value": "",
|
|
"description": "Code as header2",
|
|
"disabled": true
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"firstName\" : \"Bill\",\n \"tags\" : [ \"admin\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/:userId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users",
|
|
":userId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "userId",
|
|
"value": "",
|
|
"description": "Id of an existing user."
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Update the information of an existing user."
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "advanced",
|
|
"item": [
|
|
{
|
|
"name": "/groups/:groupId",
|
|
"description": "Get group of users",
|
|
"item": [
|
|
{
|
|
"name": "Get group by ID",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/groups/:groupId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"groups",
|
|
":groupId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "groupId",
|
|
"value": "1",
|
|
"description": "group Id"
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Get group of users"
|
|
}
|
|
,"response": [
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "/users/:userId",
|
|
"description": "Retrieve the information of the user with the matching user ID.",
|
|
"item": [
|
|
{
|
|
"name": "Get User Info by User ID",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode",
|
|
"value": "code_one",
|
|
"description": "Code as header",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "strCode2",
|
|
"value": "",
|
|
"description": "Code as header2",
|
|
"disabled": true
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/:userId",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users",
|
|
":userId"
|
|
],
|
|
"variable": [
|
|
{
|
|
"key": "userId",
|
|
"value": "",
|
|
"description": "Id of an existing user."
|
|
}
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Retrieve the information of the user with the matching user ID."
|
|
}
|
|
,"response": [
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "basic",
|
|
"item": [
|
|
{
|
|
"name": "/user",
|
|
"description": "Create a new user.",
|
|
"item": [
|
|
{
|
|
"name": "Example request for Get User",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"id\" : 777,\n \"firstName\" : \"Alotta\",\n \"lastName\" : \"Rotta\",\n \"email\" : \"alotta.rotta@gmail.com\",\n \"dateOfBirth\" : \"1997-10-31\",\n \"emailVerified\" : true,\n \"createDate\" : \"2019-08-24\",\n \"tags\" : [ \"user\", \"admin\", \"guest\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/user",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"user"
|
|
],
|
|
"variable": [
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Create a new user."
|
|
}
|
|
,"response": [
|
|
{"name": "User Created",
|
|
"code": 200,
|
|
"status": "OK",
|
|
"header": [{
|
|
"key": "Content-Type",
|
|
"value": "application/json"}
|
|
],
|
|
"_postman_previewlanguage": "json",
|
|
"cookie": [],
|
|
"body" : "{\n \"id\" : 777,\n \"firstName\" : \"Alotta\",\n \"lastName\" : \"Rotta\",\n \"email\" : \"alotta.rotta@gmail.com\",\n \"dateOfBirth\" : \"1997-10-31\",\n \"emailVerified\" : true,\n \"createDate\" : \"2019-08-24\",\n \"tags\" : [ \"user\", \"admin\", \"guest\" ]\n}",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"id\" : 777,\n \"firstName\" : \"Alotta\",\n \"lastName\" : \"Rotta\",\n \"email\" : \"alotta.rotta@gmail.com\",\n \"dateOfBirth\" : \"1997-10-31\",\n \"emailVerified\" : true,\n \"createDate\" : \"2019-08-24\",\n \"tags\" : [ \"user\", \"admin\", \"guest\" ]\n}",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/user",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"user"
|
|
],
|
|
"variable": [
|
|
],
|
|
"query": [
|
|
]
|
|
},
|
|
"description": "Create a new user."
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "/users/",
|
|
"description": "Retrieve the information of the user with the matching user ID.",
|
|
"item": [
|
|
{
|
|
"name": "Get User Info by Query Param",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Accept",
|
|
"value": "application/json",
|
|
"description": "",
|
|
"disabled": false
|
|
},
|
|
{
|
|
"key": "Custom-Header",
|
|
"value": "",
|
|
"description": "Custom HTTP header",
|
|
"disabled": true
|
|
},
|
|
{
|
|
"key": "Another-Custom-Header",
|
|
"value": "abc",
|
|
"description": "Custom HTTP header with default",
|
|
"disabled": false
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{baseUrl}}/users/",
|
|
"host": [
|
|
"{{baseUrl}}"
|
|
],
|
|
"path": [
|
|
"users"
|
|
],
|
|
"variable": [
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "pUserId",
|
|
"value": "888",
|
|
"description": "Query Id.",
|
|
"disabled": false
|
|
}
|
|
]
|
|
},
|
|
"description": "Retrieve the information of the user with the matching user ID."
|
|
}
|
|
,"response": [
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"auth": {
|
|
"type": "basic",
|
|
"basic": [
|
|
{
|
|
"key": "username",
|
|
"value": "{{USERNAME}}",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "password",
|
|
"value": "{{PASSWORD}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"variable": [
|
|
{
|
|
"key": "baseUrl",
|
|
"value": "http://localhost:{port}/{version}",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "X-API-Key",
|
|
"value": "",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "version",
|
|
"value": "v1",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"key": "port",
|
|
"value": "5000",
|
|
"type": "string"
|
|
}
|
|
]
|
|
}
|
|
|