New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api contract for users/userAvailble/:id route #20
Conversation
saishankarmanugula
commented
Jan 28, 2021
This reverts commit 1aa65be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some doubts, please clarify.
users/README.md
Outdated
Returns the availability of user name. | ||
|
||
- **Params** | ||
_Required:_ `id=[string]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: id
users/README.md
Outdated
@@ -111,6 +111,22 @@ Returns the specified user. | |||
- **Code:** 401 | |||
- **Content:** `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` | |||
|
|||
## **GET /users/userAvailable/:id** | |||
|
|||
Returns the availability of user name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please combine and make it username
users/README.md
Outdated
@@ -111,6 +111,22 @@ Returns the specified user. | |||
- **Code:** 401 | |||
- **Content:** `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }` | |||
|
|||
## **GET /users/userAvailable/:id** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be username
instead of id
, right?
users/README.md
Outdated
rds-session: `<JWT>` | ||
- **Success Response:** | ||
- **Code:** 200 | ||
- **Content:** `{ 'userAvailable': <Availability Stauts> }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like isUsernameAvailable
sounds better to me. What do you say?
Also the value should be <boolean>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏻
Also, if this route is going to require authentication (which I think it would), please add 4xx error response for unauthorized user
Also, kindly add 5xx error for server error response
You can refer contracts for other users
routes to get idea of the above two error responses.
Thank you 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you! 🎉
This looks good. Thanks @saishankarmanugula! |