This PR adds a Reponser interface, which enables us to construct any form of custom type and turn them into responses accepted by goapi-gen.
The goal of this proposal is to shorten the error handling code, and clean up ugly multi-line errors made when constructing a non-standard/specified response body.
The example provided with the petstore may not be the best because of it's short nature, but we can easily save dozens of lines of code, and standardize better with such an API.
After some more reading and code reviewing, I figured I could just reuse render's Renderer interface for it, thus changing very little, yet achieving the desired functionality.
This PR adds a
Reponser
interface, which enables us to construct any form of custom type and turn them into responses accepted by goapi-gen.The goal of this proposal is to shorten the error handling code, and clean up ugly multi-line errors made when constructing a non-standard/specified response body.
The example provided with the petstore may not be the best because of it's short nature, but we can easily save dozens of lines of code, and standardize better with such an API.