Skip to content
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

Streamline and harmonize simple responses across API routes #119

Open
aleene opened this issue Nov 7, 2022 · 7 comments
Open

Streamline and harmonize simple responses across API routes #119

aleene opened this issue Nov 7, 2022 · 7 comments
Labels

Comments

@aleene
Copy link

aleene commented Nov 7, 2022

What

The simple responses of various api's use different formats: "string", "message=text", "detail=text". Some are undocumented. This requires implementors to cater for all these variants.

Steps to reproduce the behavior:

Check the swagger doc.

Expected behavior

Have the same json format (like detail=text) for all simple responses.

@aleene aleene added the 🐛 bug Something isn't working label Nov 7, 2022
@teolemon teolemon changed the title Streamline simple responses Streamline and harmonize simple responses across API routes Nov 29, 2022
@teolemon teolemon removed the 🐛 bug Something isn't working label Dec 6, 2024
@kirtanchandak
Copy link
Contributor

working on this

@kirtanchandak
Copy link
Contributor

kirtanchandak commented Mar 1, 2025

Here we can have two options -

  1. Either we can have - {"message": "No product found matching the given tags."}
  2. Or - {"detail": {"msg": "missing value for k"}} this is present currently is some part of the codebase where for eg. k is not entered

related issue - #107

related PR - #234

@kirtanchandak
Copy link
Contributor

@CharlesNepote @teleboas

@CharlesNepote
Copy link
Member

CharlesNepote commented Mar 4, 2025

IMHO, when a list is waited, and the list is empty, we should only return a JSON empty list ([]) and not a message. See my comments in #234.

@aleene?

@ekas-7
Copy link

ekas-7 commented Mar 15, 2025

#259 Tries to address this issue we can merge it if it does not conflict with mobile and server api schema causing them to crash
@alexgarel @CharlesNepote

@areebahmeddd
Copy link
Member

Have you checked the already open PR from @suchithh ?

CC: @ekas-7

@ekas-7
Copy link

ekas-7 commented Mar 15, 2025

@suchithh PR focuses on defining a standard API response str for all routes it will take time because we need to work with mobile and server team to do it in that way while PR only changes all responses that are dict[str,str] for specific response code
so it can be integrated if possible

CC: @areebahmeddd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

6 participants