I was trying to use metadata with my Her model. While the middlware segregates the response into data, errors and metadata, but on model initialization the parameters of metadata being send-in are parsed_data[:data] instead of parsed_data[:metadata].
Saw your comment
Was curious to know if it is something that has been done intentionally or is it some feature in-dev?
Actually, that comment is not accurate anymore.
If your model data has a metadata key, it’s going to be parsed by the detault middleware (here) and passed to the initializer through the :_metadata special key (here). The initializer is going to keep it in the resource’s metadata accessor (here). Same thing goes for the errors key, which is stored in the response_errors accessor.
There was a typo in the find method though, so that currently only works in the master branch.
Hope that helps!
I’m gonna close this issue now and hope that my last comment helped you solve it!