JsonSchemaGenerator test failing for NuGet package but not GitHub source

May 29, 2014 at 11:45 PM
I cannot compile Newtonsoft.Json.Tests project using the NuGet Newtonsoft.Json 6.0.3 package. There are 147 errors if I try this.

The following produces different results depending if I am compiling against source or compiling against the 6.0.3 nuget package:

Code:
        var jsonSchemaGenerator = new JsonSchemaGenerator();
        var schema = jsonSchemaGenerator.Generate(typeof(X));
        var json = schema.ToString();
JSON compiled against Source:

{
"type": "object",
"properties": {
"x": {
  "required": true,
  "type": "integer",
  "enum": [
    0,
    1,
    -1
  ],
  "options": [
    {
      "value": 0,
      "label": "No"
    },
    {
      "value": 1,
      "label": "Asc"
    },
    {
      "value": -1,
      "label": "Desc"
    }
  ]
}
}
}


JSON compiled against Nuget:

{
"type": "object",
"properties": {
"x": {
  "required": true,
  "type": "integer",
  "enum": [
    0,
    1,
    -1
  ]
}
}
}

..this discrepancy is what prompted me to discover I can't compile Newtonsoft.Json.Tests against Newtonsoft.Json NuGet package.