CoreWCF / CoreWCF/CoreWCF

OpenApiSchemaBuilder.GetMethodUriWebInvoke can throw NullReferenceException

Open
#724 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.8k
Forks
320
PR merge metrics
No merged PRs in 30d

Description

If swagger is turned on, then CoreWCF can make it fail to show its UI with exception `Object reference not set to an instance of an object.` Stack is
```
at CoreWCF.OpenApi.OpenApiSchemaBuilder.GetMethodUriWebInvoke(MethodInfo methodInfo)
at CoreWCF.OpenApi.OpenApiSchemaBuilder.PopulateOpenApiPath(OpenApiDocument document, MethodInfo methodInfo, IEnumerable`1 tagsToHide, String additionalBasePath, WebMessageFormat behaviorFormat, Func`2 getOperationInfo)
at CoreWCF.OpenApi.OpenApiSchemaBuilder.PopulateOpenApiPathsOperations(OpenApiDocument document, IEnumerable`1 contracts, IEnumerable`1 tagsToHide)
at CoreWCF.OpenApi.OpenApiSchemaBuilder.BuildOpenApiSpecificationDocument(OpenApiOptions info, IEnumerable`1 contracts)
at CoreWCF.OpenApi.OpenApiDocumentProvider.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
```

As this is a project where conversion from net framework to net core is a WIP, its likely I've not got everything right, but some clues in the error message would be helpful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.