-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mrlazyg/dev
Updated Server List For Diff Env
- Loading branch information
Showing
3 changed files
with
214 additions
and
4 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,201 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Natours Tour API Docs", | ||
"description": "This API docs explains the use of APIs", | ||
"license": { | ||
"name": "MIT", | ||
"url": "https://opensource.org/licenses/MIT" | ||
} | ||
}, | ||
"host": ["https://visit-natours.onrender.com"], | ||
"basePath": "/api/v1", | ||
"tags": [ | ||
{ | ||
"name": "Users", | ||
"description": "API for users in the system" | ||
} | ||
], | ||
"schemes": ["http", "https"], | ||
"consumes": ["application/json", "application/xml"], | ||
"produces": ["application/json", "application/xml"], | ||
"paths": { | ||
"/users": { | ||
"post": { | ||
"tags": ["Users"], | ||
"description": "Create new user in system", | ||
"parameters": [ | ||
{ | ||
"name": "user", | ||
"in": "body", | ||
"description": "User that we want to create", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "New user is created", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
} | ||
}, | ||
"get": { | ||
"tags": ["Users"], | ||
"summary": "Get all users in system", | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/Users" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/users/{userId}": { | ||
"parameters": [ | ||
{ | ||
"name": "userId", | ||
"in": "path", | ||
"required": true, | ||
"description": "ID of user that we want to find", | ||
"type": "string" | ||
} | ||
], | ||
"get": { | ||
"tags": ["Users"], | ||
"summary": "Get user with given ID", | ||
"responses": { | ||
"200": { | ||
"description": "User is found", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"summary": "Delete user with given ID", | ||
"tags": ["Users"], | ||
"responses": { | ||
"200": { | ||
"description": "User is deleted", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
} | ||
}, | ||
"put": { | ||
"summary": "Update user with give ID", | ||
"tags": ["Users"], | ||
"parameters": [ | ||
{ | ||
"name": "user", | ||
"in": "body", | ||
"description": "User with new values of properties", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "User is updated", | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"definitions": { | ||
"User": { | ||
"required": ["email", "_id"], | ||
"properties": { | ||
"email": { | ||
"type": "string", | ||
"uniqueItems": true, | ||
"example": "john.doe@example.com" | ||
}, | ||
"firstName": { | ||
"type": "string", | ||
"example": "John" | ||
}, | ||
"lastName": { | ||
"type": "string", | ||
"example": "Doe" | ||
} | ||
} | ||
}, | ||
"Users": { | ||
"type": "array", | ||
"$ref": "#/definitions/User" | ||
}, | ||
"Tours": { | ||
"required": [ | ||
"name", | ||
"duration", | ||
"price", | ||
"maxGroupSize", | ||
"difficulty", | ||
"summary", | ||
"imageCover" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"uniqueItems": true | ||
}, | ||
"duration": { | ||
"type": "number" | ||
}, | ||
"price": { | ||
"type": "number" | ||
}, | ||
"ratingsAverage": { | ||
"type": "number", | ||
"default": 4 | ||
}, | ||
"ratingsQuantity": { | ||
"type": "number" | ||
}, | ||
"difficulty": { | ||
"type": "string" | ||
}, | ||
"discount": { | ||
"type": "number" | ||
}, | ||
"summary": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"example": "Tour Descriptions" | ||
}, | ||
"imageCover": { | ||
"type": "string" | ||
}, | ||
"images": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"startDates": { | ||
"type": "string", | ||
"format": "date-time", | ||
"example": "2021-08-19T08:37:28Z" | ||
} | ||
} | ||
} | ||
} | ||
} |