Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Runtime Exception - JSON integer is too large or small for an Int64

Abierto
#258 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
cli

Línea de trabajo

Comience por AutoRest.Swagger/PathLevelParameterConverter.cs en la línea 48 y, a continuación, siga SwaggerParser.Parse y el comando OpenApiDiff mostrado en el informe. Reproduzca el fallo con las especificaciones de ConfidentialLedger enlazadas. La tarea está terminada cuando el valor máximo de parameters.CommitParameter se pueda procesar sin la excepción de análisis de Int64 y la comparación finalice.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

I'm getting the follwing runtime exception when trying to run the tool against the following two files:

Unhandled exception. Newtonsoft.Json.JsonReaderException: JSON integer 9223372036854776000 is too large or small for an Int64. Path 'parameters.CommitParameter.maximum', line 1, position 40197.
   at Newtonsoft.Json.JsonTextReader.ParseNumber(ReadType readType)
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
   at Newtonsoft.Json.Linq.JObject.Parse(String json)
   at AutoRest.Swagger.JsonConverters.PathLevelParameterConverter..ctor(String json) in D:\a\1\s\openapi-diff\src\modeler\AutoRest.Swagger\PathLevelParameterConverter.cs:line 48
   at AutoRest.Swagger.SwaggerParser.Parse(String swaggerDocument, String fileName) in D:\a\1\s\openapi-diff\src\modeler\AutoRest.Swagger\SwaggerParser.cs:line 22
   at AutoRest.Swagger.SwaggerModeler.Compare(String fileNameOld, String swaggerOld, String fileNameNew, String swaggerNew, Settings settings) in D:\a\1\s\openapi-diff\src\modeler\AutoRest.Swagger\SwaggerModeler.cs:line 29
   at OpenApiDiff.Program.Main(String[] args) in D:\a\1\s\openapi-diff\src\core\OpenApiDiff\Program.cs:line 37
Aborted

    at ChildProcess.exithandler (node:child_process:389:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:757:14) {
  code: 134,
  killed: false,
  signal: null,
  cmd: 'dotnet /home/apiccione/.nvm/versions/node/v18.6.0/lib/node_modules/@azure/oad/dlls/OpenApiDiff.dll -o /tmp/old-resolved.json -n /tmp/new-resolved.json',
  stdout: '',
  stderr: "Unhandled exception. Newtonsoft.Json.JsonReaderException: JSON integer 9223372036854776000 is too large or small for an Int64. Path 'parameters.CommitParameter.maximum', line 1, position 40197.\n" +
    '   at Newtonsoft.Json.JsonTextReader.ParseNumber(ReadType readType)\n' +
    '   at Newtonsoft.Json.JsonTextReader.ParseValue()\n' +
    '   at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)\n' +
    '   at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)\n' +
    '   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)\n' +
    '   at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)\n' +
    '   at Newtonsoft.Json.Linq.JObject.Parse(String json)\n' +
    '   at AutoRest.Swagger.JsonConverters.PathLevelParameterConverter..ctor(String json) in D:\\a\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\PathLevelParameterConverter.cs:line 48\n' +
    '   at AutoRest.Swagger.SwaggerParser.Parse(String swaggerDocument, String fileName) in D:\\a\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\SwaggerParser.cs:line 22\n' +
    '   at AutoRest.Swagger.SwaggerModeler.Compare(String fileNameOld, String swaggerOld, String fileNameNew, String swaggerNew, Settings settings) in D:\\a\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\SwaggerModeler.cs:line 29\n' +
    '   at OpenApiDiff.Program.Main(String[] args) in D:\\a\\1\\s\\openapi-diff\\src\\core\\OpenApiDiff\\Program.cs:line 37\n' +
    'Aborted\n'
}

This seems to originate from parsing the maximum int64 9223372036854775807 here, which for some reason gets converted to 9223372036854776000 when the tool runs. The value is the same for both specs.

Please also find more details about the error in the CI pipeline: https://github.com/Azure/azure-rest-api-specs/pull/21659/checks?check_run_id=9712102995.

Lenguaje dominante
C#
Estrellas
290
Forks
50
Merge medio
2 d 21 h
PR fusionados (30 d)
10

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/openapi-diff

Todos los issues de Azure/openapi-diff

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.