openapi-generators / openapi-generators/openapi-python-client
"model_type" error when encountering "items": false
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 2k
- Fork
- 293
- Merge medio
- 34m
- PR unite (30g)
- 1
Descrizione
Describe the bug
According to the openapi 3.1 specification, tuples should be modeled using the "prefixItems" field with the "items" field being set to false (spec).
However this causes a "model_type" error as the generator expects the "items" field to be a dictionary.
OpenAPI Spec File
{
"openapi": "3.1.0",
"info": {
"title": "foobar",
"description": "",
"license": {
"name": ""
},
"version": "0.1.0"
},
"paths": {
"/my/path": {
"get": {
"description": "foo",
"operationId": "bar",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "array",
"items": false,
"prefixItems": [
{
"type": "string",
"format": "date-time"
},
{}
]
}
}
}
}
}
}
}
}
}
}
Removing the "items": false causes the file to parse successfully.
Desktop (please complete the following information):
- OS: Ubuntu 22.04.5 LTS
- Python Version: 3.10.12
- openapi-python-client version 0.24.1
Guida per i contributori
Apri la guida per i contributori
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.
Direzione di ricerca
Inizia riproducendo l’errore model_type con la specifica OpenAPI 3.1 inclusa nell’issue, concentrandoti sullo schema di array annidato in cui items è false e prefixItems è presente. Traccia il percorso di analisi o validazione dello schema che presuppone che items sia un dizionario. Il lavoro è completato quando la specifica fornita viene analizzata correttamente e un test di regressione copre questa forma tupla.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- openapi, python
- Ambito
- backend-api-design, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100