Skip to content

Nested exposure double-exposes a field #57

Closed
@Nerian

Description

@Nerian

Hi,

class Thing
  def something
    'hello'
  end
end

class Thing::Entity < Grape::Entity
  expose :fields do
    expose :something
  end
end

returns: 

{
  "thing": {
    "fields": {
      "something": "hello"
    },
    "something": "hello"
  }
}

I would expect:

{
  "thing": {
    "fields": {
      "something": "hello"
    },
  }
}

Is this the expected behaviour? How can I get what I want?

I am using master

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