Improve the error reported in the log for a NullReferenceException issue
- Lenguaje dominante
- C#
- Estrellas
- 290
- Forks
- 50
- Merge medio
- 5 d 13 h
- PR fusionados (30 d)
- 5
Descripción
The following error seems to be caused by spec issues, but it doesn't have enough information to trace the real issues.
```
Error: appendOadRuntimeErrors: {"type":"Raw","level":"Error","message":"Runtime Exception","time":"2025-08-06T20:28:16.228Z","groupName":"preview","extra":{"new":"https://github.com/stevemunk/azure-rest-api-specs/blob/ec36d0206de5a236b79e079611bcd25df47362cd/specification/maps/data-plane/Microsoft.Maps/Alias/preview/2.0/alias.json","old":"https://github.com/Azure/azure-rest-api-specs/blob/main/specification/maps/data-plane/Microsoft.Maps/Alias/preview/2.0/alias.json","details":"Command failed: dotnet /home/runner/work/azure-rest-api-specs/azure-rest-api-specs/node_modules/\\@azure/oad/dlls/OpenApiDiff.dll -o /tmp/oad-6bw2a3/old-resolved.json -n /tmp/oad-2X5zP2/new-resolved.json\nUnhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.\n at AutoRest.Swagger.Model.ServiceDefinition.ReferenceTrackSchemas(ServiceDefinition service) in D:\\a\\_work\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\Model\\ServiceDefinition.cs:line 509\n at AutoRest.Swagger.Model.ServiceDefinition.Compare(ComparisonContext`1 context, ServiceDefinition previousDefinition) in D:\\a\\_work\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\Model\\ServiceDefinition.cs:line 321\n at AutoRest.Swagger.SwaggerModeler.Compare(String fileNameOld, String swaggerOld, String fileNameNew, String swaggerNew, Settings settings) in D:\\a\\_work\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\SwaggerModeler.cs:line 34\n at OpenApiDiff.Program.Main(String[] args) in D:\\a\\_work\\1\\s\\openapi-diff"}}
```
Pipeline run:
https://github.com/Azure/azure-rest-api-specs/actions/runs/16787747592/job/47542471322?pr=36493
Guía de contribución
Línea de trabajo
Comienza con ServiceDefinition.cs en ReferenceTrackSchemas, en la línea 509; después sigue Compare en la línea 321 y SwaggerModeler.cs en la línea 34. Reproduce el fallo usando el comando OpenApiDiff.dll y los archivos resueltos antiguo/nuevo mostrados en los detalles del error. Se considera terminado cuando el registro informa de suficiente contexto para rastrear el problema subyacente de la especificación, en lugar de informar únicamente de la NullReferenceException.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- cli
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100