RicoSuter / NJsonSchema

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

DescriptionAttributes are not serializing with latest verison. #1652

Open JohnGalt1717 opened 9 months ago

JohnGalt1717 commented 9 months ago

Here's my code

               var generatorSettings = new JsonSchemaGeneratorSettings {
            SerializerSettings = null,
            SerializerOptions = JsonSerializerSettings.AIInputOptions,
            UseXmlDocumentation = false
        };

        var schema = JsonSchema.FromType<TType>(generatorSettings) ??
            throw new InvalidOperationException();

        return schema.ToJson();

Here's an example object.

    [Description("The Details of An Article")]
    private record PreProcessRequest([Description("The title of the article")] string title, [Description("The Summary of the article")] string summary);

Does this not work with records?