-
Notifications
You must be signed in to change notification settings - Fork 2
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
Documentation #44
Documentation #44
Conversation
let { token } = req.cookies; | ||
if (req?.headers?.swaggerToken) { | ||
token = req.headers.swaggerToken; | ||
} |
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.
I had to send the authentication token with a header because the Cookie
or Set-Cookie
headers are forbidden headers and the browser forbids swagger from setting them.
You can refer to this issue that explains the problem, and this MDN article for forbidden headers list.
Hey @AmmarBaki2 good job with the docs. Would you be able to add the screenshot of the docs here? I need it for home page and also it may be good to see the docs ss here. |
Thank you @mehmetfatiherdem for the suggestion 😊 |
@Peri7at @mehmetfatiherdem Can you do the first review for this PR today? @Peri7at You can focus on auth routes and user routes in your review. Let's divide and conquer! |
Hey @AmmarBaki2, I checked the screenshot and realized that the DELETE request for the item has the same explanation with the PUT. Did you forget it while writing :D or is the screenshot not up to date? |
src/swagger.json
Outdated
} | ||
}, | ||
"delete": { | ||
"summary": "Updates the item data with the specified 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.
this should be "Deletes the item data with the specified 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.
Thank you for pointing this out 😁
It happens a lot when copying and pasting from the other endpoints 😅
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.
By the way, instead of adding a comment for each change, you can press the start a review
button and once you finish the review, go back to the top and press on finish review, add a general comment, and choose if you are requesting changes or approving and then submit them as one review
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.
yeah, I normally do that but for changes like grammar mistakes or wrong messages, I just leave a comment immediately :D
Hey @AmmarBaki2, I tried to post an item and then update and delete them. When I do update and delete, it gives me only item owner can modify error. Are they working or am I doing something wrong? |
This is an error in the item controller not in the documentation, I will fix it tomorrow. It is basically taking the owner's id from the request body but it should take it from req.user instead so |
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.
Good work @AmmarBaki2 👏
Hi @Shrreya, do we have to document |
src/swagger.json
Outdated
"info": { | ||
"version": "1.0.0", | ||
"title": "Paying It Forward", | ||
"description": "This is the documentation for Paying It Forward API. To access the paths that have a lock symbol next to it, you can send a signin request under Auth tab and copy the token from the `authorizationToken` response header and paste it in the `Authorize 🔒` section.", |
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 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.
It is not necessary to copy and paste authorization token. After signing in you can access locked endpoints automatically.
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.
Yeah you are right, it seems that it is using the browser's cookies
I will edit the description to what you suggested, and I will remove the swagger token from everywhere
Hello @Shrreya I added all remaining endpoints and tested them |
Added the documentation for all endpoints
I added the
/global/all-items
and/global/donators
underItems
andUsers
respectively because we still didn't determine what should we do with them, moving them toGlobal
would be quite easy if we decide so.closes #28