RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.4k stars 534 forks source link

Array type is generating as Tuple #1634

Closed SimonFrisendahl closed 1 year ago

SimonFrisendahl commented 1 year ago

I attempted to convert the provided JSON schema into C# classes using the CSharpGenerator tool. However, I noticed that the events property is being converted to a System.Tuple<int, string, bool> instead of the expected ICollection<System.Tuple<int, string, bool>>.

I suspect, I might be a misunderstanding something or I may be missing a configuration option during the conversion process. Any help or advise on how to accomplish the goal on converting the json schema would be deeply appreciated


{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "boolean"
        }
      ]
    }
  }
}