NullReferenceException when generating code for a parameter with no schema
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #502 di @github-actions — integrata
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- fsharp
- Ambito
- api
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- F#
- Stelle
- 278
- Fork
- 60
- Merge medio
- 18h 21m
- PR unite (30g)
- 10
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsprojects/SwaggerProvider
-
agentic-workflows automation repo-assist
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
fsprojects/SwaggerProvider#411 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs investigation
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
fsprojects/SwaggerProvider#490 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
automation documentation repo-assist
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
fsprojects/SwaggerProvider#489 ·
I maintainer di solito rispondono entro 1 giorno
-
automation blocked enhancement repo-assist
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
fsprojects/SwaggerProvider#358 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fsprojects/SwaggerProvider#33 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fsprojects/SwaggerProvider
Issue simili
-
area: capture good first issue priority: P2 type: defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jiegui2025/hwspec#51 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]:Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
thephpleague/commonmark#1159 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EchoTools/nevr-runtime#117 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Proxy drops log notifications from backends that don't send FastMCP's msg/extra dictForse già presa @asasemahmed l’ha presa oggi. Apertabug server
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno