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 8634713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:47:26+00:00 2026-06-12T09:47:26+00:00

I am trying to consume a 3rd party JSON API, and was expected that

  • 0

I am trying to consume a 3rd party JSON API, and was expected that a null value would have no value at all provided, left out of the result, or some default. Instead the API returns back [] in place of a single value (not something that would be an array) if the value doesn’t exist:

"SomeExpectedDate": [],
"SomeExpectedString": [],
...

When I try to deserialize this using JayRock JsonConvert, it fails since i’m trying to load into single String or DateTime values.

Is this normal, or should I go complain to the API provider (this is a recently introduced API)

  • 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-06-12T09:47:27+00:00Added an answer on June 12, 2026 at 9:47 am

    In general, no. In JSON [] indicates an empty array. If you want to represent a null value, use the null keyword. Like:

    {"someString": null}
    

    Although in terms of how you want to represent a null value in your JSON, that is entirely up to you. If you write the receiving code so that it understands that an empty array is equivalent to null, that will certainly work.

    In my opinion however that would be a very questionable/unreliable/difficult maintain approach. It makes a lot more sense to use the null keyword, or failing that, an empty string ({"someString": ""}).

    Edit:

    To respond to your update about this issue being related to consuming a third-party API, I think definitely this is an issue to take up with the API provider. They should not be returning [] if what they really mean is null. While what they’re sending is technically still valid JSON, it’s semantically questionable for them to be using [] instead of null.

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

Sidebar

Related Questions

I'm trying to consume and use a third party REST Json based API. I
I am trying to consume data from a webservice published by a 3rd party.
Facebook has a new Batch request Graph API that I'm trying to consume. The
I'm trying to consume SmartyStreets JSON LiveAddress API and I'm having some difficulties. I
I'm currently trying to consume a FORTRAN DLL that I have been given by
I am trying to consume my newly setup JSON service. I have created a
I'm trying to consume data from a 3rd party web service. Unfortunately, the web
I'm trying to write a Java app in GAE that consumes some 3rd party
Im trying to consume a Java web-service, that uses a certificate. I could generate
I'm trying to consume a RESTful JSON web service using WCF on the client

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.