-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Updating from 0.2.2 to 0.2.3 breaks entities? #304
Comments
Do you have a |
Yeah, I have |
It might need some debugging. I'd appreciate a repro. What should be called is |
Sure. I'm not sure what I could tell you that might reproduce it. I'm not really doing anything out of the ordinary. The endpoint looks like this: class API < Grape::API
format :json
mount PracticesController
end
class PracticesController < Grape::API
get "/practices" do
practices = PracticeRepository.all.sort { |a,b| a.name <=> b.name }
present practices, with: PracticeEntity
end
end The PracticeEntity looks like this: class PracticeEntity < Grape::Entity
root "practices", "practice"
expose :id, :name
expose :practitioners, using: PractitionerEntity
expose :offices, using: OfficeEntity
expose :open_appointments_for_the_next_week, using: AppointmentEntity
end How can I help? |
The most helpful would be a spec that reproduces this problem inside Grape. |
I might be able to manage that, although it would be helpful for me to have a better understanding of what kind of state the library and test coverage is in for entities. Is everything largely working and really well-covered? Because I consistently have issues getting basic functionality from the documentation to work. For example, I wanted to remove the repetitive |
I think coverage is very good, but Entities are a very recent feature, so probably not as good. Either way, with every person working on it we get closer to where it needs to be. |
For sure. OK, I don't use RSpec, but I'll see if I can hack out some failing tests. |
Fixed. The issue with with You should try HEAD. I also think that you should be able to work around this in 0.2.3 by using |
Interesting. Thanks for sorting that out! |
I just updated from 0.2.2 to 0.2.3, removed
error_format
because I see in the changelog that that was removed, ran my tests, and about 10% of them failed. Most of the failures look something like this:So I'm guessing the entities aren't being serialized for some reason? I took a look through the diff between v0.2.2 and v0.2.3 and didn't see anything glaring, but I'm not really familiar with the codebase. What am I missing?
The text was updated successfully, but these errors were encountered: