Skip to content

Commit

Permalink
Added sample swagger definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrash committed Oct 15, 2022
1 parent 62b837b commit 066fc46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 82 deletions.
2 changes: 1 addition & 1 deletion src/routes/shortcut.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ShortcutRoute implements Routes {
this.router.post(`${this.route}/search/`, validationMiddleware(SearchShortcutDto, 'body'), verifyToken,
this.shortcutController.searchShortcut);
this.router.post(`${this.route}/create/:email`, verifyToken, this.shortcutController.createShortcut);
this.router.delete(`${this.route}/delete/:email/:shortLink`, verifyToken, this.shortcutController.deleteShortcut);
this.router.delete(`${this.route}/delete/:shortLink`, verifyToken, this.shortcutController.deleteShortcut);


}
Expand Down
84 changes: 3 additions & 81 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,13 @@ tags:
description: Users API

paths:
/users:
/users/{email}:
get:
tags:
- Users
summary: Find All Users
responses:
200:
description: 'OK'
500:
description: 'Server Error'
post:
tags:
- Users
summary: Add User
parameters:
- name: body
in: body
description: user Data
required: true
schema:
$ref: '#/definitions/users'
responses:
201:
description: 'Created'
400:
description: 'Bad Request'
500:
description: 'Server Error'
put:
tags:
- Users
summary: Update User By _id
summary: Find User By email
parameters:
- name: body
in: body
description: user Data
required: true
schema:
$ref: '#/definitions/users'
responses:
200:
description: 'OK'
400:
description: 'Bad Request'
409:
description: 'Conflict'
500:
description: 'Server Error'
/users/{_id}:
get:
tags:
- Users
summary: Find User By id
parameters:
- name: _id
- name: email
in: path
description: User id
required: true
Expand All @@ -68,37 +20,7 @@ paths:
description: 'Conflict'
500:
description: 'Server Error'
delete:
tags:
- Users
summary: Delete User By id
parameters:
- name: _id
in: path
description: user Id
required: true
responses:
200:
description: 'OK'
409:
description: 'Conflict'
500:
description: 'Server Error'


definitions:
users:
type: object
required:
- _id
- name
properties:
_id:
type: number
description: User Id
name:
type: string
description: User Name
schemes:
- https
- http

0 comments on commit 066fc46

Please sign in to comment.