Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Specs update suggestions #661

Open
nhaancs opened this issue Apr 28, 2021 · 3 comments
Open

Specs update suggestions #661

nhaancs opened this issue Apr 28, 2021 · 3 comments
Labels
Status: Approved approved for next version Status: RFC awaiting for comments to be approved v2 changelog

Comments

@nhaancs
Copy link

nhaancs commented Apr 28, 2021

Frontend

  • Could we remove # character from url? I think the url will look better without #.

Backend

  • Use abstract keywork in responses to make them more abstract and reusable.
    • For example, with get single article api we can return:
    {
      "data": {
         ...
       }
     }
    
    instead of
    {
      "article": {
         ...
       }
     }
    
    • With get list of articles api we can return:
    {
      "data": [
         ...
       ],
       "total": 20
     }
    
    instead of
    {
      "articles": {
         ...
       },
       articlesCount: 20
     }
    
    • And the same for update, create responses
  • Server also return messages for create, update, delete, favorite,.. requests. For example: {..., message: "article created successfully"}
  • A create api should only return created id, frontend need to call api with the id to get what it needs
@geromegrignon
Copy link
Contributor

Hello @nhaancs,

Could we remove # character from url? I think the url will look better without #.

Indeed. It's being tracked already with #536

About the API specs, we'll adress them with the ongoing v2 as it would introduce breaking changes on implementations fro the current version.

@geromegrignon
Copy link
Contributor

Server also return messages for create, update, delete, favorite,.. requests. For example: {..., message: "article created successfully"}

What's the motivation? The 2xx is enough information for clients to be confident that their request was properly handled.

@geromegrignon
Copy link
Contributor

A create api should only return created id, frontend need to call api with the id to get what it needs

About such change, I would propose not to include data for PUT requests

@geromegrignon geromegrignon added Status: Approved approved for next version Status: RFC awaiting for comments to be approved and removed suggestion v2 labels Nov 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Status: Approved approved for next version Status: RFC awaiting for comments to be approved v2 changelog
Projects
Status: No status
Development

No branches or pull requests

3 participants