openapi-generators / openapi-generators/openapi-python-client
Linting error when class has a property with the same name after snake case
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 2k
- Fork
- 293
- Merge medio
- 34m
- PR unite (30g)
- 1
Descrizione
openapi-python-client: 0.21.4
Python: 3.10
OpenAPI spec version: 3.0.3
In OpenAPI specs where a property has the same name as the snake cased class name (in the example below, the snake casing is the lower case, but if it was, ex, InstagramId, then this would happen with a property named instagram_id) the code generated has a duplicated variable name (see image below).
The suggested fix is that the return variable name should have an underscore _, in this example, email_.
"Email": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"verified": {
"type": "boolean"
}
},
"required": [
"email",
"type"
]
},
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
Riprodurre il problema con lo snippet OpenAPI 3.0.3 fornito usando openapi-python-client 0.21.4 e ispezionare il modello Email generato. Seguire il percorso del generatore che sceglie i nomi per la variabile di ritorno e la proprietà, quindi verificare che i nomi generati non entrino più in conflitto e che l’esempio rimanga Python valido.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- openapi, python
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100