-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Describe the bug
Fix from #1993 (comment) is not possible to do now.
Version of NSwag toolchain, computer and .NET runtime used
NSwag 14.6.2
Dotnet 10
To Reproduce
public class EnumDocumentProcessor : IDocumentProcessor
{
public void Process(DocumentProcessorContext context)
{
foreach (var schemaPair in context.Document.Components.Schemas)
{
var schema = schemaPair.Value;
if (schema.IsEnumeration)
{
schema.ExtensionData ??= new Dictionary<string, object>();
schema.ExtensionData.Add("x-enum-varnames", schema.EnumerationNames.ToArray());
}
}
}
}After applying this document processor, there are no x-enum-varnames in the schema.
Expected behavior
Adding properties to ExtensionData works.
Additional context
This is happening because there is EnumerationVarNamesRaw property that is mapped to x-enum-varnames. And because it is defined, data from ExtensionData is not used.
Metadata
Metadata
Assignees
Labels
No labels