RicoSuter / NSwag

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

The generated nswag is invalid because of ambiguous references V14.0.3 #4768

Open michaelSant0s opened 8 months ago

michaelSant0s commented 8 months ago

Swagger json has added extra bit required fields for the Exception and also has new models, such as MethodAttributes, MethodBase ect. which are the public properties of the class System.Exception.

generated C# api image

webserver referenced version 14. image

simeyla commented 7 months ago

The Angular / typescript client also generated an invalid enumeration with duplicated values that for some reason weren't separated. But of course the main error is that it's generated MethodBase in the first place.

export type MethodAttributes = "PrivateScope""PrivateScope" | "Private" | "FamANDAssem" | "Assembly" | "Family" | "FamORAssem" | "Public" | "MemberAccessMask" | "UnmanagedExport" | "Static" | "Final" | "Virtual" | "HideBySig" | "NewSlot" | "NewSlot" | "CheckAccessOnOverride" | "Abstract" | "SpecialName" | "RTSpecialName" | "PinvokeImpl" | "HasSecurity" | "RequireSecObject" | "ReservedMask";

export type MethodImplAttributes = "IL""IL" | "Native" | "OPTIL" | "CodeTypeMask" | "CodeTypeMask" | "ManagedMask" | "ManagedMask" | "NoInlining" | "ForwardRef" | "Synchronized" | "NoOptimization" | "PreserveSig" | "AggressiveInlining" | "AggressiveOptimization" | "InternalCall" | "MaxMethodImplVal";
JinjinM commented 7 months ago

Yes, I have got the same issue. Do you have some workaround for it?