You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cool, I was thinking about it a little more over the weekend and it possible you'd want to have pluralized versions of representers as well. I'll work something up and submit a pull request. Thanks.
PR #46 documents and verifies Grape’s built-in lookup: assign a representer module or decorator to Product::Entity, then call present product without with:. Decorator classes also support API-local represent Product, with: ProductRepresenter mappings without modifying the model. An explicit with: overrides inference.
This avoids global class-name guessing and singular/plural ambiguity. It does not silently mutate arbitrary endpoint return values; call present to request inference. Request regressions cover both module/decorator inference, overrides, and API-local mapping.
Activity
dblock commentedon Aug 26, 2013
That could work, yes.
johnallen3d commentedon Aug 26, 2013
Cool, I was thinking about it a little more over the weekend and it possible you'd want to have pluralized versions of representers as well. I'll work something up and submit a pull request. Thanks.
[-]Lookup Representers Dynamically?[/-][+]Lookup Representers Dynamically[/+]thisiscab commentedon Jul 22, 2015
Is there any progress on this?
johnallen3d commentedon Jul 22, 2015
Sorry, I've not been working
roarof late and haven't gotten back to this.dblock commentedon Oct 27, 2026
PR #46 documents and verifies Grape’s built-in lookup: assign a representer module or decorator to
Product::Entity, then callpresent productwithoutwith:. Decorator classes also support API-localrepresent Product, with: ProductRepresentermappings without modifying the model. An explicitwith:overrides inference.This avoids global class-name guessing and singular/plural ambiguity. It does not silently mutate arbitrary endpoint return values; call
presentto request inference. Request regressions cover both module/decorator inference, overrides, and API-local mapping.Posted by Copilot, an AI, on behalf of @dblock.