Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:10:20+00:00 2026-05-23T12:10:20+00:00

I have a serialized JSON String (chef role definition actually) and it has a

  • 0

I have a serialized JSON String (chef role definition actually) and it has a json_class key, making the ruby JSON parser try to force it to be a Chef::Role object. How can I make the parser ignore this key and just simply deserialize into a normal Hash?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:10:21+00:00Added an answer on May 23, 2026 at 12:10 pm

    I just had the same problem, and found the answer by reading the source of the JSON gem – just unset JSON.create_id before trying to do the parse:

    JSON.create_id = nil
    JSON.parse('{ "json_class": "Chef::Role" }').class => Hash
    

    EDIT: Note that since version 1.7 of the gem (1.8.0 is current as I type this update), the above hack is no longer necessary. JSON#parse now ignores json_class, and JSON#load should be used instead for unmarshalling dumped objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a serialized json string in the format: [{\Version\:\8.63\,\Date\:\07\/11\/2011 00:00:00\,\Count\:213}, {\Version\:\1.0\,\Date\:\07\/11\/2011 00:00:00\,\Count\:1}, .........
I have a string which gets serialized to JSON in Javascript, and then deserialized
I have a method that retrieves data from a json serialized string and writes
I have an indented JSON string e.g. { a: 1 } However, I don't
Possible Duplicate: JSON serialization of c# enum as string I have two classes as
I have an Android app which uses Jackson parser for JSON parsing. After I've
I have an object model called MyObject that I'm serializing to a json string
I have a table in which I need to store some serialized json strings
In C#, I have successfully serialized an anonymous object into JSON by use of
I have a problem deserializing a JSON string using Jackson (but I have no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.