RicoSuter / NSwag

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

Handling Preflight Requests in Generated Controllers in AspNetCore 2.2 #2086

Open pdeveau opened 5 years ago

pdeveau commented 5 years ago

I have a controller class in asp.net core that is generated with nswag studio. The attributes that are autogenerated route for an OPTIONS preflight call. Not sure if I'm doing something wrong in other configuration or if the generated code is incorrect.

[Microsoft.AspNetCore.Mvc.HttpPut, Microsoft.AspNetCore.Mvc.Route("api/resource/{id}")] public System.Threading.Tasks.Task<FileResponse> ApiGeneratedMethod(System.Guid id, [Microsoft.AspNetCore.Mvc.FromBody] Resource resource) { }

RicoSuter commented 5 years ago

Probably not yet supported by the generator