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

Refactor JSON responses with a reusable component #593

Open
csc-felipe opened this issue Sep 29, 2022 · 0 comments
Open

Refactor JSON responses with a reusable component #593

csc-felipe opened this issue Sep 29, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@csc-felipe
Copy link
Contributor

csc-felipe commented Sep 29, 2022

Proposed solution

In #578, some of the JSON responses were refactored, and work could continue from there to have a reusable JSON response component.

As seen in

async def _json_response(data: Union[Dict, List[Dict]]) -> Response:
"""Reusable json response, serializing data with ujson.
:param data: Data to be serialized and made into HTTP 200 response
"""
return web.Response(
body=ujson.dumps(data, escape_forward_slashes=False), status=200, content_type="application/json"
)

DoD (Definition of Done)

Refactor endpoints returning JSON response to use a new reusable JSON response component, improving it as necessary.

Testing

@csc-felipe csc-felipe added the enhancement New feature or request label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant