Describe the bug
mentorship_relation file has few routes that uses hardcoded status codes instead of HTTPStatus.
To Reproduce
Steps to reproduce the behavior:
Mentorship Relation/mentorship_relation/{request_id}Expected behavior
HTTPStatus.XYZ should have been displayed instad of raw status codes
Screenshots

The above image shows hardcoded status codes. It should show the status in the below format:-

Additional Context
Also, find whether any such hard coded status codes are used for other routes and fix them.
Can I work on this issue?
currently i have no issue assigned...i would like to work on this
I would like to work on this
Can I work on this?
Assigning @sreelekha901 since she is not assigned to any issue and asked first.
I need some help to proceed with this issue
What do you need help with @sreelekha901 ?
@PrashanthPuneriya can you please update the issue title and description to fix all hard coded status codes instead of mentorship_relation file
@PrashanthPuneriya @isabelcosta can I take this up?
I don't think that this issue is valid anymore. Can you please reproduce it first @Aaishpra ?
Just a comment, actually, the value being shown on Swagger UI should be in number format: so 200 instead of HTTPStatus.OK. In the code it should use the HTTPStatus enum, but it should show the real number in the Swagger UI. I think this issue is not about that, but it is instead about if is there numbers hardcoded in the code (instead of enums). so this should still be checked how @devkapilbansal said. Thank you for coming with this @devkapilbansal
We should additionally have an issue to make sure the SwaggerUI shows the values and not the enum representation. that is an implementation detail. the solution might be something like using str(HTTPStatus.OK) or HTTPStatus.OK.value, not sure 馃
@devkapilbansal you are right this issue is not valid anymore, I reproduced it in the Heroku app and the status codes are displayed correctly for mentorship relations, #924 already solved it.
Just a comment, actually, the value being shown on Swagger UI should be in number format: so 200 instead of
HTTPStatus.OK. In the code it should use theHTTPStatusenum, but it should show the real number in the Swagger UI. I think this issue is not about that, but it is instead about if is there numbers hardcoded in the code (instead of enums). so this should still be checked how @devkapilbansal said. Thank you for coming with this @devkapilbansalWe should additionally have an issue to make sure the SwaggerUI shows the values and not the enum representation. that is an implementation detail. the solution might be something like using
str(HTTPStatus.OK)orHTTPStatus.OK.value, not sure thinking
@isabelcosta @devkapilbansal shall I open the issue and work on it according to as @isabelcosta suggested.
Ok so if this is not valid anymore I will close this @devkapilbansal @Aaishpra
@Aaishpra yes, you can create the issue for it and work on it :) Try to create an issue for a module of the code. For example, you can create an issue to do what I mentioned for Admin API or Mentorship Relation API or User API. So that the file changes in the code review are "small" and easier to review. Makes sense?
You can start with an issue for showing the values on Admin API, and then if the others are still available you continue those. Just let me know once you create the issue so we can assign it to you :)
Ok so if this is not valid anymore I will close this @devkapilbansal @Aaishpra
@Aaishpra yes, you can create the issue for it and work on it :) Try to create an issue for a module of the code. For example, you can create an issue to do what I mentioned for Admin API or Mentorship Relation API or User API. So that the file changes in the code review are "small" and easier to review. Makes sense?
You can start with an issue for showing the values on Admin API, and then if the others are still available you continue those. Just let me know once you create the issue so we can assign it to you :)
Thanks, @isabelcosta got your point will create an issue for the mentorship_relation Api first and work on it and after that we can create more for the remaining APIs.
Most helpful comment
Assigning @sreelekha901 since she is not assigned to any issue and asked first.