[Issue 15273] New: json.d parseJSON doesnt parse current json string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Nov 2 04:19:36 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15273

          Issue ID: 15273
           Summary: json.d parseJSON doesnt parse current json string
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: a_perfilev at mail.ru

jsonValue is empty after parseJSON

Here is code example:

import std.json;

public static void main() {
string jsondata =
"{\"results\":[{\"paramName\":\"GeoEnrichmentResult\",\"dataType\":\"GeoEnrichmentResult\",\"value\":{\"version\":\"2.0\",\"FeatureSet\":[{\"displayFieldName\":\"\",\"fieldAliases\":{\"OBJECTID\":\"Object
ID\",\"ID\":\"ID\",\"sourceCountry\":\"sourceCountry\",\"HasData\":\"HasData\",\"TOTPOP\":\"Total
Population\",\"TOTHH\":\"Total Households\",\"TOTMALES\":\"Male
Population\",\"TOTFEMALES\":\"Female Population\",\"AVGHHSZ\":\"Average
Household
Size\"},\"fields\":[{\"name\":\"OBJECTID\",\"type\":\"esriFieldTypeOID\",\"alias\":\"Object
ID\"},{\"name\":\"ID\",\"type\":\"esriFieldTypeString\",\"alias\":\"ID\",\"length\":256},{\"name\":\"sourceCountry\",\"type\":\"esriFieldTypeString\",\"alias\":\"sourceCountry\",\"length\":256},{\"name\":\"HasData\",\"type\":\"esriFieldTypeInteger\",\"alias\":\"HasData\"},{\"name\":\"TOTPOP\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Total
Population\",\"fullName\":\"KeyGlobalFacts.TOTPOP\",\"component\":\"demographics\",\"decimals\":0,\"units\":\"count\"},{\"name\":\"TOTHH\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Total
Households\",\"fullName\":\"KeyGlobalFacts.TOTHH\",\"component\":\"demographics\",\"decimals\":0,\"units\":\"count\"},{\"name\":\"TOTMALES\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Male
Population\",\"fullName\":\"KeyGlobalFacts.TOTMALES\",\"component\":\"demographics\",\"decimals\":0,\"units\":\"count\"},{\"name\":\"TOTFEMALES\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Female
Population\",\"fullName\":\"KeyGlobalFacts.TOTFEMALES\",\"component\":\"demographics\",\"decimals\":0,\"units\":\"count\"},{\"name\":\"AVGHHSZ\",\"type\":\"esriFieldTypeDouble\",\"alias\":\"Average
Household
Size\",\"fullName\":\"KeyGlobalFacts.AVGHHSZ\",\"component\":\"scripts\",\"decimals\":2,\"units\":\"count\"}],\"features\":[{\"attributes\":{\"OBJECTID\":1,\"ID\":\"0\",\"sourceCountry\":\"US\",\"HasData\":1,\"TOTPOP\":318536439,\"TOTHH\":120746349,\"TOTMALES\":156936483,\"TOTFEMALES\":161599956,\"AVGHHSZ\":2.57}}]}]}}],\"messages\":[]}";
JSONValue jsonValue = parseJSON(jsondata);
}

--


More information about the Digitalmars-d-bugs mailing list