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

  • Home
  • SEARCH
  • 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 6039157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:19:39+00:00 2026-05-23T06:19:39+00:00

I want to deserialize the following json data https://mtgox.com/code/data/getDepth.php . I keep getting an

  • 0

I want to deserialize the following json data https://mtgox.com/code/data/getDepth.php. I keep getting an error. Below is my code.

Gson gson = new Gson();  
String json =  readHTTPS(new URL("https://mtgox.com/code/data/getDepth.php"));
AskBids askBids  = gson.fromJson(json, AskBids.class);   

My AskBids class look like:

public class AskBids {

 private  String [] []   asks;
 private String [] []  bids;

 public AskBids(){}
}

The error is get is com.google.gson.JsonParseException: Expecting object found: “asks”

Any ideas? Thanks

  • 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-23T06:19:40+00:00Added an answer on May 23, 2026 at 6:19 am

    The JSON linked in the original question contains over 2,800 JSON tokens, element names and values. Here is a small section of that example that maintains the exact same structure.

    {
        "asks": [
            [
                18.22,
                15.362
            ],
            [
                25.4682,
                20
            ]
        ],
        "bids": [
            [
                18.06,
                50
            ],
            [
                18.0099,
                32.64
            ]
        ]
    }
    

    That said, I copy-pasted the deserialization code from the original question, using both the original JSON and the shorter version I pasted above, and the code ran without error as expected.

    Based on the error message Expecting object found: "asks", I suspect that the readHTTPS(URL) method is not returning the correct result, in that it is not including the opening { of the JSON. If this is the problem, but for some reason readHTTPS(URL) cannot be fixed, you could always “fix” its output by just concatenating the missing character(s).

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

Sidebar

Related Questions

I have the following situation below. This code will throw a compiler error for
want to rewrite urls like site.com/software to wp-content/themes/dir/software.php and something is not working.. Here's
I want to deserialize a JSON object (using GSON, because I already use it
I am currently using Json.Net to deserialize my JSON. I now have the following
I have a exception from lift-json when I want to deserialize a json string.
i have a Json, i want to deserialize and save it inside the property
I want to deserialize an object but don't know the class up front. So,
I'm currently convering my ASP.NET v2 application to serialize/deserialize it's objects because I want
Want to code a key pad for an calculator. What I want to make
I have the following C# helper class which retrieves a Json String from a

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.