0.1.7 • Published 2 years ago
easy-swagger v0.1.7
EASY SWAGGER
This package allows you to create your swagger documentation in a simple and easy way.
Getting Started
Install package
# npm
npm install easy-swagger
# yarn
yarn add easy-swaggerCreate swagger document
npx easy-swagger --root=./srcGenerate interactive API
npx easy-swagger-uiFolder structure
API with controllers
└── src/
└── api-name/
└── api-version/
├── api.json
└── controller-name/
└── service-name/
├── request.json
└── status-code/
└── response.jsonExample:
└── src/
└── pets/
└── v1/
│ ├── api.json
│ └── users/
│ │ └── login/
│ │ ├── request.json
│ │ └── 200/
│ │ │ └── response.json
│ │ └── 401/
│ │ │ └── response.json
│ │ └── 500/
│ │ └── response.json
│ └── stores/
│ └── inventory/
│ ├── request.json
│ └── 200/
│ │ └── response.json
│ └── 400/
│ └── response.json
└── v2/
├── api.json
└── users/
│ └── sign-in/
│ ├── request.json
│ └── 200/
│ │ └── response.json
│ └── 401/
│ └── response.json
└── stores/
└── inventory/
├── request.json
└── 200/
│ └── response.json
└── 500/
└── response.jsonAPI without controllers
└── src/
└── api-name/
└── api-version/
├── api.json
└── service-name/
├── request.json
└── status-code/
└── response.jsonExample:
└── src/
└── pets/
└── v1/
│ ├── api.json
│ └── login/
│ │ ├── request.json
│ │ └── 200/
│ │ │ └── response.json
│ │ └── 401/
│ │ │ └── response.json
│ │ └── 500/
│ │ └── response.json
│ └── inventory/
│ ├── request.json
│ └── 200/
│ │ └── response.json
│ └── 400/
│ └── response.json
└── v2/
├── api.json
└── sign-in/
│ ├── request.json
│ └── 200/
│ │ └── response.json
│ └── 401/
│ └── response.json
└── inventory/
├── request.json
└── 200/
│ └── response.json
└── 500/
└── response.jsonDocuments
api.json
{
"title": "API name",
"description": "API description",
"version": "v1",
"servers": [
{
"description": "Production server URL",
"url": "https://api.example.com/v1"
},
{
"description": "Test server URL",
"url": "https://test.example.com/v1"
}
]
}| Key | Description | Type Value |
|---|---|---|
| title | The name of the API | string |
| description | A description of the API | string |
| version | The version of the API | string |
| servers | List of server objects | list |
Server list:
| Key | Description | Type Value |
|---|---|---|
| description | A description of the server | string |
| url | The URL of the server | string |
request.json
{
"body": {
"username": "",
"password": "",
"level": 10
},
"headers": {
"token": "Bearer token",
"x-api-key": "api-key"
},
"queries": {
"limit": 10,
"page": 1,
"search": ""
},
"params": {
"id": 10
},
"form": {},
"contentType": "application/json",
"method": "post",
"description": "Generic description",
"path": "/controller/endpoint/{id}",
"tag": "tag-group"
}| Key | Description | Type Value |
|---|---|---|
| body | Request body parameters | Object |
| headers | Request headers | Object |
| queries | URL query parameters | Object |
| params | URL path parameters | Object |
| form | Form data parameters | Object |
| contentType | Content type of the request | string |
| method | HTTP method | string |
| description | Description of the request | string |
| path | Endpoint path | string |
| tag | Tag group | string |
response.json
{
"body": {
"message": "",
"success": true,
"errores": []
},
"headers": {
"token": "Bearer token",
"time-stamp": ""
}
}| Key | Description | Type Value |
|---|---|---|
| body | Response body parameters | Object |
| headers | Response headers | Object |
License
The Easy Swagger is licensed under the CC-BY-NC-4.0 license.
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago