RicoSuter / NJsonSchema

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

Unable to generate document when XmlElement[] is a property of the class #1695

Open thompson-tomo opened 4 months ago

thompson-tomo commented 4 months ago

The below exception

The JSON property 'ItemOf' is defined multiple times on type 'System.Xml.XmlAttributeCollection'.

when the following method is used var generator = new JsonSchemaGenerator(options.SchemaOptions); jsonSchemaGenerator.Generate(payloadType, schemaResolver) where the payload has the below property

public System.Xml.XmlElement[] Any;

On further testing the below has not helped either _options.SchemaOptions.ExcludedTypeNames = new[] { nameof(System.Xml.XmlElement), };

Note i am attempting to use Saunter, to generate the documentation but am failing due to that property. V11 of the library is in usage.

Further troubleshooting has identified that in my case the excludedtypes is not processed in this flow hence my issue.