Skip to content

Object reference not set to an instance of an object only in v2.json in 1.2.0 package #377

@jassent

Description

@jassent

I upgraded from .81 preview which was running fine. This is .net6 running isolated/out-of-process.

When using the 1.1.0 package, I can use the Swagger UI and generate the OpenApi document.

However, upgrading to 1.2.0 causes the OpenApi endpoint (/api/openapi/v2.json) to return the error listed below. The Swagger UI and Swagger.json endpoint (/api/swagger.json) work fine under 1.2.0. OpenApi endpoint /api/openapi/v3.json renders fine in 1.2.0.

It is the /api/openapi/v2.json endpoint that will not render under 1.2.0 which is what is needed for Azure Logic Apps Custom Connectors.

This is not an issue of needing to include a dependency as my project has many dependencies in all shared solutions.

Also, for some reason both 1.1.0 and 1.20.0 required adding System.Drawing.Common which seems like an odd package to require.

`Object reference not set to an instance of an object.

at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Extensions.DocumentHelperExtensions.<>c__DisplayClass6_0.b__5(KeyValuePair2 p) at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Extensions.DocumentHelperExtensions.GetOpenApiParameters(IDocumentHelper helper, MethodInfo element, HttpTriggerAttribute trigger, NamingStrategy namingStrategy, VisitorCollection collection, OpenApiVersionType version) at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Document.Build(Assembly assembly, OpenApiVersionType version) at Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Functions.OpenApiTriggerFunction.RenderOpenApiDocument(HttpRequestData req, String version, String extension, FunctionContext ctx)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions