essencebit / SignalRSwaggerGen

MIT License
70 stars 8 forks source link

MissingMethod exception after updating SwaggerGen to 6.3.0 #18

Closed CaringDev closed 2 years ago

CaringDev commented 2 years ago

Swashbuckle.SwaggerGen introduced a binary breaking change from 6.2.x to 6.3.0 by adding a new routeInfo (default) parameter to ISchemaGenerator.GenerateSchema. This leads to:

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 SignalRSwaggerGen.SignalRSwaggerGen.GetOpenApiSchema(DocumentFilterContext context, Type type) at SignalRSwaggerGen.SignalRSwaggerGen.<>c__DisplayClass8_0.b__0(ParameterInfo param) at System.Linq.Enumerable.WhereSelectArrayIterator2.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at SignalRSwaggerGen.SignalRSwaggerGen.AddOpenApiPath(OpenApiDocument swaggerDoc, DocumentFilterContext context, SignalRHubAttribute hubAttribute, String tag, String methodPath, Operation operation, String summary, String description, IEnumerable`1 methodParams, ParameterInfo methodReturnParam, MethodInfo method, MemberElement methodXml) at SignalRSwaggerGen.SignalRSwaggerGen.ProcessMethod(OpenApiDocument swaggerDoc, DocumentFilterContext context, SignalRHubAttribute hubAttribute, String hubPath, String tag, MethodInfo method, MemberElement methodXml) at SignalRSwaggerGen.SignalRSwaggerGen.ProcessHub(OpenApiDocument swaggerDoc, DocumentFilterContext context, Type hub, XmlComments xmlComments) at SignalRSwaggerGen.SignalRSwaggerGen.Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Strictly, this is a problem of SwaggerGen, however... Would you consider bumping SwaggerGen to the latest version?

Dorin-Mocan commented 2 years ago

@CaringDev , of course! I'll release a new version asap. Stay tuned. Thanks for letting me know about the issue.

Dorin-Mocan commented 2 years ago

@CaringDev , version 3.1.0 released. Please check.

CaringDev commented 2 years ago

Thanks, 3.1.0 works like a charm.