




Field | Description | Required or Not |
OpenAPI | Specify the version number, for example, 3.0.0 | Yes |
servers | Define the BaseURL list for APIs | No, but it is advisable to fill in to generate a valid URL. |
info | API metadata, including title, version, and description. | Yes |
paths | Define all endpoints (such as /users) and its HTTP methods (GET/POST) | Yes |
components | Store reusable models, parameters, and responses, such as schemas defining data structure | No |
openapi: "3.0.0"info:title: "Test API"version: "1.0.0"description: "Fill in the plugin description herein"servers:- url: "https://example.com/api"description: "Fill in the plugin description herein"paths:"/weatherInfo":get:summary: "API name"description: "Fill in the API description of the plugin herein"operationId: "getWeatherInfo"parameters:- name: "city"in: "query"description: "Parameter description"required: trueschema:type: "string"responses:"200":description: "Successful response"content:application/json:schema:type: "object"properties:status:type: "integer"description: "Return status"enum: [0, 1]"400":description: "Error request""401":description: "Unauthorized""500":description: "Server error"
{"openapi": "3.0.0","info": {"title": "Test API","version": "1.0.0","description": "Fill in the plugin description herein"},"servers": [{"url": "https://example.com/api","description": "Fill in the plugin description herein"}],"paths": {"/weatherInfo": {"get": {"summary": "API name","description": "Fill in the API description of the plugin herein","operationId": "getWeatherInfo","parameters": [{"name": "city","in": "query","description": "Parameter description","required": true,"schema": {"type": "string"}}],"responses": {"200": {"description": "Successful response","content": {"application/json": {"schema": {"type": "object","properties": {"status": {"type": "integer","description": "Return status""enum": [0,1]}}}}}},"400": {"description": "Error request"},"401": {"description": "Unauthorized"},"500": {"description": "Server error"}}}}}}
Field | Description | Required or Not |
swagger | Specify the version number, for example, 2.0 | Yes |
host | Domain name | No, but it is advisable to fill in to generate a valid URL. |
basePath | Base path | No, but it is advisable to fill in to generate a valid URL. |
schemes | Supported protocols, such as HTTP or HTTPS | No, but it is advisable to fill in to generate a valid URL. |
info | API metadata, including title, version, and description. | Yes |
paths | Define all endpoints (such as /users) and its HTTP methods (GET/POST) | Yes |
definition | Data model, equivalent to OpenAPI's components/schemas | No |
swagger: "2.0"info:title: User APIversion: 1.0.0description: Example Swagger 2.0 documenthost: "example.com"basePath: "/api"schemes:- "https"paths:/users:# GET requestget:summary: Get all usersresponses:'200':description: return successfully the list of usersschema:type: objectproperties:users:type: arrayitems:$ref: '#/definitions/User'# POST requestpost:summary: Create a new userparameters:- in: bodyname: userrequired: trueschema:$ref: '#/definitions/User'responses:'201':description: user created successfullydefinitions:User:type: objectrequired:- nameproperties:id:type: integerreadOnly: trueexample: 1name:type: stringexample: "Tom"email:type: stringformat: emailexample: "user@example.com"
{"swagger": "2.0","info": {"title": "User API","version": "1.0.0","description": "Example Swagger 2.0 document"},"host": "example.com","basePath": "/api","schemes": ["https"],"paths": {"/users": {"get": {"summary": "Get all users","responses": {"200": {"description": "return successfully the list of users","schema": {"type": "object","properties": {"users": {"type": "array","items": {"$ref": "#/definitions/User"}}}}}}},"post": {"summary": "Create a new user","parameters": [{"in": "body","name": "user","required": true,"schema": {"$ref": "#/definitions/User"}}],"responses": {"201": {"description": "user created successfully"}}}}},"definitions": {"User": {"type": "object","required": ["name"],"properties": {"id": {"type": "integer","readOnly": true,"example": 1},"name": {"type": "string","example": "Tom"},"email": {"type": "string","format": "email","example": "user@example.com"}}}}}
Field | Description | Required or Not |
info | Collection metadata, including Collection Name and collection version | Yes |
item | Request list, each request requires a specific method and URL | Yes |
request | Request detail, including header, body, auth | Yes |
auth | Configure authentication, such as API Key | No |
event | Pre-request Script or Test Script | No |
{"info": {"name": "User API Collection","version": "1.0.0","description": "Sample Postman collection with GET and POST requests"},"item": [{"name": "GetAllUsers","request": {"method": "GET","description": "GetAllUsers","header": [{"key": "Content-Type","value": "application/json"}],"url": {"raw": "https://api.example.com/users","protocol": "https","host": ["api.example.com"],"path": ["users"]}},"response": []},{"name": "CreateUser","request": {"method": "POST","description": "CreateUser","header": [{"key": "Content-Type","value": "application/json"}],"body": {"mode": "raw","raw": "{\\"name\\": \\"John Doe\\", \\"email\\": \\"john@example.com\\"}"},"url": {"raw": "https://api.example.com/users","protocol": "https","host": ["api.example.com"],"path": ["users"]}},"response": []}]}




Feedback