RicoSuter / NSwag

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

🐛 Fix generated C# clients using base URL #4674

Closed elafarge closed 10 months ago

elafarge commented 10 months ago

I do believe that the following PR introduced a typo in the #pragma directive. https://github.com/RicoSuter/NSwag/pull/4634/files#diff-65b33706483249f53a8138451372e3d3276b904d815dcb71d0ed0c8786ea2e70R8

I think it slipped through testing because it only concerns generated C# clients generated using the UseBaseUrl=true option.

When trying to generate my client with this option enabled (unfortunately, I can't do without it), I'm getting the following compiler error on the #pragma restore disable 8618 line: error CS1633: Unrecognized #pragma directive.

I'm by no means an expert on these directives, but I do believe that the correct syntax is #pragma warning restore 8618.

This PR should fix the issue, introduced in NSwag 14.0.0.

Fixes: https://github.com/RicoSuter/NSwag/issues/4673

anev-auror commented 10 months ago

Is there an expected release date for this fix?