You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating a swagger api doc with the latest swashbuckle (Swashbuckle.AspNetCore.SwaggerGen 6.6.2) will cause a generation error due to the use of [FromForm] IFormFile in the WorkflowDefinition Import and Restore-Controller.
Steps to Reproduce
To help us identify the issue more quickly, please follow these guidelines:
Update sample to latest swashbuckle and try to produce swagger documentation, the following exception will occur: Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - Elsa.Server.Api.Endpoints.WorkflowDefinitions.Import.Handle (Elsa.Server.Api). See inner exception ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Error reading parameter(s) for action Elsa.Server.Api.Endpoints.WorkflowDefinitions.Import.Handle (Elsa.Server.Api) as [FromForm] attribute used with IFormFile. Please refer to https://github.com/domaindrivendev/Swashbuckle.AspNetCore#handle-forms-and-file-uploads for more information
If you follow the link you will find documentation that [FromForm] should not be used with IFormFile. Removing the attribute solves the issue.
Description
Generating a swagger api doc with the latest swashbuckle (Swashbuckle.AspNetCore.SwaggerGen 6.6.2) will cause a generation error due to the use of [FromForm] IFormFile in the WorkflowDefinition Import and Restore-Controller.
Steps to Reproduce
To help us identify the issue more quickly, please follow these guidelines:
Update sample to latest swashbuckle and try to produce swagger documentation, the following exception will occur:
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - Elsa.Server.Api.Endpoints.WorkflowDefinitions.Import.Handle (Elsa.Server.Api). See inner exception ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Error reading parameter(s) for action Elsa.Server.Api.Endpoints.WorkflowDefinitions.Import.Handle (Elsa.Server.Api) as [FromForm] attribute used with IFormFile. Please refer to https://github.com/domaindrivendev/Swashbuckle.AspNetCore#handle-forms-and-file-uploads for more information
If you follow the link you will find documentation that [FromForm] should not be used with IFormFile. Removing the attribute solves the issue.
Relevant code signature:
public async Task<IActionResult> Handle(string workflowDefinitionId, [FromForm] IFormFile? file, CancellationToken cancellationToken) {
Thanks for looking into this.
The text was updated successfully, but these errors were encountered: