RicoSuter / NJsonSchema

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

JsonSchemaTypeAttribute support multiple types #1577

Open darkflame0 opened 1 year ago

darkflame0 commented 1 year ago

example

        [JsonSchemaType(typeof(string),typeof(string[]))]
        public object Prop { get; set; }

or

        [JsonSchemaType(typeof(string))]
        [JsonSchemaType(typeof(string[]))]
        public object Prop { get; set; }
probablyadev commented 1 year ago

You can do the following as a work around:

[JsonSchemaExtensionData("type", new[] { "boolean", "integer", "string" })]
public object Value { get; set; }