1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

Json Schema Queries

Discussion in 'Census: General Discussion' started by Ionian Tinnear, Dec 18, 2014.

  1. Is the a mechanism we can use to just return the schema for the data structure that would be returned from a GET that returns Json (or any format really)?

    This would be helpful since numeric data elements appear to return only significant digits. So, if the data value an whole number then it looks like and integer, even though it could be decimal on other requests.

    I use json2csharp.com to build c# objects from json objects, but it can only use what data it sees to 'guess' a data elements type. I could, I suppose, cast everything as object..
  2. Daaaaave

    Daaaaave New Member

    Visual Studio 2015 and later versions:

    1. Copy JSON result to clipboard
    2. Create an empty class file (cs. or .vb doesn't matter)
    3. Edit -> Paste Special -> Paste JSON as Classes
    4. Some generated int values may be wrong and have to set to long.
    4. Done

Share This Page