Goa bytes request decoder
What is this
Custom Goa decoder for HTTP requests: it just reads the bytes from the request body.
Why is needed
The default Goa decoders always make some transformations on the request bytes, like decoding JSON/XML. Only if the request content-type is text/plain
the default decoders don't transform the data.
For some endpoints we need the pure JSON bytes from the request without any transformation, which is impossible to achieve with the default decoders, because the content-type of the request will be application/json
, and they will decode the JSON into some value (interface, map, struct).
This decoder will just read the bytes and place them in the given variable.