-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When upgrading to .NET 10 RC2, we're getting a NRE when generating the OpenAPI spec:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.OpenApi.Generated.<OpenApiXmlCommentSupport_generated>F7E62C7FD2203B967FCD31756AA54279EC2C453447E3E8D9733B7416CC2CDD1D5__XmlCommentOperationTransformer.TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken) in D:\Code\bim-platform-service\src\Procore.ApiServices\obj\Debug\net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs:line 463
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOperationsAsync(IGrouping`2 descriptions, OpenApiDocument document, IServiceProvider scopedServiceProvider, IOpenApiOperationTransformer[] operationTransformers, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
I tried debugging the code and it turns out that ModelMetadata is null here:
Could this be because we're using slightly unconventional parameter naming? I.e. we have snake_case_lower API parameter, but conventional camelCase parameter names in the controller:
Expected Behavior
No NullReferenceException 😆
Steps To Reproduce
I'm not entirely sure
Exceptions (if any)
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.OpenApi.Generated.<OpenApiXmlCommentSupport_generated>F7E62C7FD2203B967FCD31756AA54279EC2C453447E3E8D9733B7416CC2CDD1D5__XmlCommentOperationTransformer.TransformAsync(OpenApiOperation operation, OpenApiOperationTransformerContext context, CancellationToken cancellationToken) in D:\Code\bim-platform-service\src\Procore.ApiServices\obj\Debug\net10.0\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs:line 463
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.GetOperationsAsync(IGrouping`2 descriptions, OpenApiDocument document, IServiceProvider scopedServiceProvider, IOpenApiOperationTransformer[] operationTransformers, IOpenApiSchemaTransformer[] schemaTransformers, CancellationToken cancellationToken)
.NET Version
10.0.100-rc.2.25502.107
Anything else?
No response