Open coreypmurphy opened 7 years ago
@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 notifications@github.com 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 AMS@0.9.3.
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): Rails@5.0.2
For reference this is a migration to AMS@0.10.6 and JSONAPI from AMS@0.9.3. 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 AMS@0.10.6.