NullReferenceException when generating code for a parameter with no schema
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #502 de @github-actions — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- fsharp
- Área
- api
Línea de trabajo
Start with OperationCompiler.fs around line 206 to trace how a parameter with Content is represented, then follow the call into DefinitionCompiler.fs around line 440 where schemaObj is null. Run the provider against the OpenAPI document in the issue and verify code generation completes for the parameter whose schema is nested under Content.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi,
I tried pointing the provider at an OpenApi schema on a new project at work, and got a NullReferenceException from it, causing the build to fail.
Trying to minimise the issue, it looks like if I have something like
{
"openapi": "3.1.1",
"info": {
"title": "Testing | v1",
"version": "0.2.0.0"
},
"paths": {
"/api/v1/catalogues/scan": {
"post": {
"tags": [
"Catalogue"
],
"summary": "Testing",
"description": "Testing",
"operationId": "Scan",
"parameters": [
{
"name": "properties",
"in": "header",
"description": "header description",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"stage-location": {
"type": "string",
"description": "location"
},
"file-size": {
"minimum": 0,
"type": "integer",
"format": "int64"
}
}
}
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
}
}
}
The the provider gets to https://github.com/fsprojects/SwaggerProvider/blob/4e299fd52e64fc2354a99e2acec3420078c4f7f0/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs#L440 and then throws because schemaObj is null.
Looking higher up the callstack around https://github.com/fsprojects/SwaggerProvider/blob/4e299fd52e64fc2354a99e2acec3420078c4f7f0/src/SwaggerProvider.DesignTime/OperationCompiler.fs#L206, current.Schema is null, but it does have a 'Content' property, and that does contain a schema.
This is as far as I've got looking at it so far, will have another look next week if no one else of repo assist gets to it first.
Thanks.
- Lenguaje dominante
- F#
- Estrellas
- 278
- Forks
- 60
- Merge medio
- 18 h 21 min
- PR fusionados (30 d)
- 10
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fsprojects/SwaggerProvider
-
agentic-workflows automation repo-assist
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
fsprojects/SwaggerProvider#411 ·
Los mantenedores suelen responder en 1 día
-
bug needs investigation
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
fsprojects/SwaggerProvider#490 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
automation documentation repo-assist
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
fsprojects/SwaggerProvider#489 ·
Los mantenedores suelen responder en 1 día
-
automation blocked enhancement repo-assist
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
fsprojects/SwaggerProvider#358 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
fsprojects/SwaggerProvider#33 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de fsprojects/SwaggerProvider
Issues similares
-
Python: Bug: split_plaintext_paragraph / split_markdown_paragraph can return a chunk larger than max_tokensPosiblemente ocupada @xThreeh la tomó hoy. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/semantic-kernel#14566 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
java-native-access/jna#1740 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Variables passed to Compensated are not set on the routing slipQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
MassTransit/MassTransit#6249 ·
-
bug code cleaning
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
furrer-lab/abn#272 ·