-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested exposure double-exposes a field #57
Labels
Comments
It should do what you expect. Can you please share code that reproduces the problem? |
Sure here it is: ➜ example gem list | grep grape
grape (0.6.1)
grape-entity (0.4.1) #config.ru require 'grape'
require 'grape-entity'
class Thing
def something
'hello'
end
end
class Thing::Entity < Grape::Entity
expose :fields do
expose :something
end
end
module Twitter
class App < Grape::API
get :some_action do
present :thing, Thing.new
end
end
end
run Twitter::App Do You should see: {
"thing":
{
"fields": { "something":"hello" },
"something":"hello"
}
} |
Unless I am missing something, I think it's most definitely a bug with nested exposures. If you want to be helpful, write a test within grape-entity for this. Maybe you can also fix it :) |
Nerian
added a commit
to Nerian/grape-entity
that referenced
this issue
Feb 17, 2014
Nerian
added a commit
to Nerian/grape-entity
that referenced
this issue
Feb 17, 2014
Nerian
added a commit
to Nerian/grape-entity
that referenced
this issue
Feb 17, 2014
AMar4enko
added a commit
to AMar4enko/grape-entity
that referenced
this issue
Feb 28, 2014
AMar4enko
added a commit
to AMar4enko/grape-entity
that referenced
this issue
Feb 28, 2014
AMar4enko
added a commit
to AMar4enko/grape-entity
that referenced
this issue
Feb 28, 2014
AMar4enko
added a commit
to AMar4enko/grape-entity
that referenced
this issue
Feb 28, 2014
AMar4enko
added a commit
to AMar4enko/grape-entity
that referenced
this issue
Feb 28, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Is this the expected behaviour? How can I get what I want?
I am using master
The text was updated successfully, but these errors were encountered: