RicoSuter/NSwag

Handling Preflight Requests in Generated Controllers in AspNetCore 2.2

Open

#2,086 opened on Apr 4, 2019

 (1 comment) (0 reactions) (0 assignees)C# (1,356 forks)batch import
help wantedproject: NSwag.CodeGeneration.CSharp (Controllers)

Repository metrics

Stars
 (7,358 stars)
PR merge metrics
 (PR metrics pending)

Description

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) { }

Contributor guide