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
I have a Rails 5 app in API mode using this gem and active_model_serializers. devise_token_auth's controllers renders plain hashes as responses but neither of all the 3 adapters from active_model_serializers seem to be able to render the hashes to JSON.
Versions:
Rails 5. (--api mode)
active_model_serializers: 0.10.2
devise_token_auth: 0.1.37 (tried 0.1.39, still the same)
Expected response body: { success: false, errors: ['User was not found or was not logged in.'] }
Actual response (with the default active_model_serializer adapter): {}
With the active_model_serializer :json_api adapter: NoMethodError (undefined method read_attribute_for_serialization' for {:errors=>["User was not found or was not logged in."]}:Hash)`
With the active_model_serializer :json adapter: NoMethodError (undefined methodmodel_name' for Hash:Class):`
I filled an issue over there rails-api/active_model_serializers#1893 as well. I've read some other issues here that imply most devise_token_auth users are using active_model_serializers as well. What is the proper configuration (if any) between both gems?
I can provide a repo that reproduces this issue if needed.
The text was updated successfully, but these errors were encountered:
dnlsandiego
changed the title
API responses are empty when using active_model_serializers
API response bodies are empty when using active_model_serializers
Aug 28, 2016
@lynndylanhurley Sorry to specifically tag you on this but I've been stuck on this issue for about almost a week. Any idea on what would be causing this?
I have a Rails 5 app in API mode using this gem and active_model_serializers.
devise_token_auth
's controllers renders plain hashes as responses but neither of all the 3 adapters from active_model_serializers seem to be able to render the hashes to JSON.Versions:
Rails 5. (--api mode)
active_model_serializers: 0.10.2
devise_token_auth: 0.1.37 (tried 0.1.39, still the same)
Expected behavior vs actual behavior
curl -i -X DELETE http://localhost:3000/v1/auth/sign_out
Expected response body:
{ success: false, errors: ['User was not found or was not logged in.'] }
Actual response (with the default active_model_serializer adapter):
{}
With the active_model_serializer
:json_api
adapter:NoMethodError (undefined method
read_attribute_for_serialization' for {:errors=>["User was not found or was not logged in."]}:Hash)`With the active_model_serializer
:json
adapter:NoMethodError (undefined method
model_name' for Hash:Class):`I filled an issue over there rails-api/active_model_serializers#1893 as well. I've read some other issues here that imply most devise_token_auth users are using active_model_serializers as well. What is the proper configuration (if any) between both gems?
I can provide a repo that reproduces this issue if needed.
The text was updated successfully, but these errors were encountered: