RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.69k stars 1.24k forks source link

Why is my schema processor called twice for the same type, once with partial data? #1911

Open sandersaares opened 5 years ago

sandersaares commented 5 years ago

I am attempting to implement a schema processor that would add some custom metadata to the output. However, I find that Task ProcessAsync(SchemaProcessorContext context) is often called twice for the same type, except the second time it does not seem to have any data in context.Schema.

This pattern confuses me and complicates the implementation. I request clarification on what are the correct patterns for implementing schema processors and how I am supposed to handle this type of duplicate input to ensure correct operation of NSwag.

RicoSuter commented 5 years ago

Looks like a bug - needs investigation in - probably in NJsonSchema