-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Deserialization excludes hash attribute contents #2219
Comments
@bf4 , thanks. I had read those earlier but seeing as how long those have been open I was hoping I had just missed something. Between that and the disclaimer about "Deserialization" being an experimental feature I guess I should have known better. Real bummer since we're trying to move our project to JSON API. Any thoughts on how soon we'll see that branch hit master? |
I was hoping you could help
B mobile phone
… On Nov 9, 2017, at 3:18 PM, Corey Murphy ***@***.***> wrote:
@bf4 , thanks. I had read those earlier but seeing as how long those have been open I was hoping I had just missed something. Between that and the disclaimer about "Deserialization" being an experimental feature I guess I should have known better. Real bummer since we're trying to move our project to JSON API. Any thoughts on how soon we'll see that branch hit master?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I appreciate the offer but I'm not completely confident I could pick up where you guys have left off. |
Expected behavior vs actual behavior
Given a model with an attribute that is treated as a hash of options, I'm expecting AMS to deserialize the JSON payload so I can persist the "some-options" attribute (re-serialized as YAML by the ActiveRecord::Base "serialize" method) to the db as it did in [email protected].
But
ActiveModelSerializers::Deserialization.jsonapi_parse()
is excluding the contents of "some-options" during deserialization. Other attributes are deserialized as expected.Steps to reproduce
POSTed JSON payload:
Model:
Controller:
config/initializers/json_api.rb
Environment
ActiveModelSerializers Version (commit ref if not on tag): 0.10.6
Output of
ruby -e "puts RUBY_DESCRIPTION"
: ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin16]OS Type & Version: OSX 10.12.4
Integrated application and version (e.g., Rails, Grape, etc): [email protected]
For reference this is a migration to [email protected] and JSONAPI from [email protected]. Our Ember frontend was using "ActiveModelAdapter", so we had Ember dealing with key transforms and serialization on requests coming to Rails and our strong params implementation wasn't being "deserialized" as they are in [email protected].
The text was updated successfully, but these errors were encountered: