Swashbuckle.AspNetCore 6.3.0 compatibility - Problems after upgrading
guimabdo opened this issue · 1 comments
guimabdo commented
Hello,
When upgrading Swashbuckle.AspNetCore from 6.2.3 to 6.3.0, the following error starts to occur:
warn: MicroElements.Swashbuckle.FluentValidation.FluentValidationRules[0]
Error on apply rules for operation 'myapi'.
System.MissingMethodException: Method not found: 'Microsoft.OpenApi.Models.OpenApiSchema Swashbuckle.AspNetCore.SwaggerGen.ISchemaGenerator.GenerateSchema(System.Type, Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository, System.Reflection.MemberInfo, System.Reflection.ParameterInfo)'.
at MicroElements.Swashbuckle.FluentValidation.SwashbuckleSchemaProvider.GetSchemaForType(Type type)
at MicroElements.Swashbuckle.FluentValidation.FluentValidationOperationFilter.ApplyInternal(OpenApiOperation operation, OperationFilterContext context) in /home/runner/work/MicroElements.Swashbuckle.FluentValidation/MicroElements.Swashbuckle.FluentValidation/src/MicroElements.Swashbuckle.FluentValidation/Swashbuckle/FluentValidationOperationFilter.cs:line 116
at MicroElements.Swashbuckle.FluentValidation.FluentValidationOperationFilter.Apply(OpenApiOperation operation, OperationFilterContext context) in /home/runner/work/MicroElements.Swashbuckle.FluentValidation/MicroElements.Swashbuckle.FluentValidation/src/MicroElements.Swashbuckle.FluentValidation/Swashbuckle/FluentValidationOperationFilter.cs:line 81
This causes parameter validation not to be passed to the OpenApi spec.
In Swashbuckle.AspNetCore 6.3.0 the ISchemaGenerator.GenerateSchema
method has changed:
I suppose that this change started the problem.
enclave-alistair commented
Just to add that I'm also encountering this same issue having upgraded to 6.3.0 of Swashbuckle. I imagine this library will need updating to understand the new routeInfo
argument on GenerateSchema
as well as changing the minimum required version.