[ruby-core:74586] [Ruby trunk Bug#12219] JSON.parse does not resolve to specific Class by 'json_class' attribute, when symbolize_names:true

From: kek.forums@...
Date: 2016-03-26 12:36:21 UTC
List: ruby-core #74586
Issue #12219 has been reported by Petr Novak.

----------------------------------------
Bug #12219: JSON.parse does not resolve to specific Class by 'json_class' attribute, when symbolize_names:true
https://bugs.ruby-lang.org/issues/12219

* Author: Petr Novak
* Status: Open
* Priority: Normal
* Assignee: Yui NARUSE
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------

When I enable symbolize_names, than parser does not match the 'json_class' attribute.  The Hash instance is returned instead of expected instance of class defined in 'json_class' attribute. 

~~~
JSON.parse(json, :create_additions => true, symbolize_names: true)
~~~

The attached Test demonstrates this issue. 



---Files--------------------------------
json_create_test.rb (975 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next