Project

General

Profile

Actions

Bug #12219

closed

JSON.parse does not resolve to specific Class by 'json_class' attribute, when symbolize_names:true

Added by kek.forums@gmail.com (Petr Novak) about 8 years ago. Updated over 6 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
[ruby-core:74586]

Description

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) json_create_test.rb kek.forums@gmail.com (Petr Novak), 03/26/2016 12:00 PM

Updated by naruse (Yui NARUSE) over 6 years ago

  • Status changed from Open to Closed
  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED

JSON library's upstream is https://github.com/flori/json.
Could you report it to there?

Actions

Also available in: Atom PDF

Like0
Like0