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

Support response payload serializer for views #163

Conversation

phantran
Copy link

@phantran phantran commented Apr 4, 2023

What does this PR do?

Introducing a response payload serializer to validate and serialize response payload.

What issue does this solve?

#162 Support for using separate serializers for the request and response payloads in views. This would allow us to ensure that the data is properly serialized and deserialized in both directions. When combining this feature with the no model view, we can support compute API endpoints.

Where should the reviewer start?

Starting at AbstractBaseAPI where the new attribute response_serializer is declared, then go to render_to_response method in APIResponse class where response_serializer is conditionally used if it's defined. The method serialize_response in SerializeModels is where the serialization is performed

What Worf gif best describes this PR or how it makes you feel?

https://i.gifer.com/HHsI.gif

Checklist

  • This PR increases test coverage
  • This PR includes README updates reflecting any new features/improvements to the framework

@phantran phantran marked this pull request as ready for review April 4, 2023 16:54
@phantran phantran requested a review from wadewilliams as a code owner April 4, 2023 16:54
@phantran phantran changed the title Support response serializer for views Support response payload serializer for views Apr 4, 2023
@phantran phantran force-pushed the improvement/add-serializer-for-response-payload branch 3 times, most recently from e388f54 to fdbec1d Compare April 4, 2023 17:34
@phantran phantran force-pushed the improvement/add-serializer-for-response-payload branch from 876732a to 8951af9 Compare April 4, 2023 17:51
@stevelacey stevelacey closed this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants