RicoSuter/NSwag

ExtensionData for Operations won't allow objects with properties named "type"

Open

#2.934 geöffnet am 3. Juli 2020

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)C# (1.189 Forks)batch import
help wantedtype: bug

Repository-Metriken

Stars
 (6.291 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Hi, I'm using NSwag to generate swagger definition file and using custom IOperationProcessor implementation to add new node at operation's level.

The below code(part of IOperationProcessor.Process method) won't add type property to the result schema, all other fields are added fine, if I use TYPE it is also included, but type seems like is filtered out/ignored.

context.OperationDescription.Operation.ExtensionData[Key] = new
{
     type="any value",
     otherNormalField="other value",
     ...
};

I would assume that extension data has to support any property names - is that correct?

Please advise!

Contributor Guide