Skip to content

expose as: in child class doesn't override parent class exposure #286

Closed
@magni-

Description

@magni-
class BaseEntity < Grape::Entity
  expose :id
end

class FooEntity < BaseEntity
  expose :id, as: :foo_id
end

This used to work in 0.4.5, but stopped once we upgraded.

Whereas before we'd have {foo_id: 1}, we now get {id: 1, foo_id: 1}

edit: the temp fix is to add unexpose :id to FooEntity, but that's a bit ugly... and it used to work without it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions