SkywardApps / popcorn

Popcorn is a .Net Middleware for your RESTful API that allows your consumers to request exactly as much or as little as they need, with no effort from you.
https://skywardapps.github.io/popcorn/
MIT License
59 stars 19 forks source link

Add a default response wrapper for .net implementation layer. #7

Closed undiwahn closed 7 years ago

undiwahn commented 7 years ago

We offer an 'inspector' option that allows users to intercept a response from a controller and 'wrap' it in some way. Internally, we use this pretty consistently to provide a 'Response' object containing a boolean 'Success' status, object 'Data' property (on success) and strings for ErrorCode, Message, and Details (on error).

It would be convenient for users who are setting up a brand new API to offer a default implementation that does this, as it has many benefits.

alexbarbato commented 7 years ago

@undiwahn - I'll give this one a go