Added poetry as a dependency manager for the consumer app, and implemented endpoints to mirror intended usage in the app. I have also added a custom response such that all successfull responses are envloped as follows:
This simplifies how clients can integrate with the API as:
All expected data will be in data otherwise it will be None/null
Clients can use meta.success to verify responses to simplify logic on their end vs comparing with response codes.
errors will contain a list of error codes to provide to clients, e.g. [VERIFY_TOKEN_404].
Note: The implementation details for errors requires overriding all HTTPExceptions and will be implemented in a seperate PR. Error handling will be implemented in another PR for simplicity and means we can start using this for local development, hence errors being empty by default.
How to Review Changes?
Verify poetry works: follow the README to run the app via poetry locally
Verify implementation works: Visit the swagger documentation and verify that the endpoints return mock data in the implemented envelope
Overview
Added poetry as a dependency manager for the consumer app, and implemented endpoints to mirror intended usage in the app. I have also added a custom response such that all successfull responses are envloped as follows:
This simplifies how clients can integrate with the API as:
data
will be indata
otherwise it will be None/nullmeta.success
to verify responses to simplify logic on their end vs comparing with response codes.errors
will contain a list of error codes to provide to clients, e.g. [VERIFY_TOKEN_404
].Note: The implementation details for errors requires overriding all HTTPExceptions and will be implemented in a seperate PR. Error handling will be implemented in another PR for simplicity and means we can start using this for local development, hence errors being empty by default.
How to Review Changes?