openapi-generators / openapi-generators/openapi-python-client
Won't generate client for JSON formatted API with tabs
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 2k
- Fork
- 293
- Merge medio
- 34m
- PR unite (30g)
- 1
Descrizione
Describe the bug
Running
openapi-python-client generate --url https://raw.githubusercontent.com/wikimedia/mediawiki-extensions-Wikibase/e45d4f725e25a95ec2b034238fd3736f19053a16/repo/rest-api/specs/openapi.json
gives me the error
Error(s) encountered while generating, client was not created
Invalid YAML from provided source: while scanning for the next token
found character '\t' that cannot start any token
in "<byte string>", line 2, column 1:
"openapi": "3.1.0",
^
This is a follow-on to this old bug https://github.com/openapi-generators/openapi-python-client/issues/488 which got fixed in https://github.com/openapi-generators/openapi-python-client/commit/b01db03349eb83e4c3ffdd1cc70f7eb2a9c6dae8 . It appears the fix doesn't quite work because github doesn't serve JSON files with the expected content-type (curl with -v gives me "< content-type: text/plain; charset=utf-8").
OpenAPI Spec File
I was trying to generate a client for this code
Desktop (please complete the following information):
- OS: Ubuntu 20.04.6 LTS running under Windows 11
- Python Version: 3.8.0
- openapi-python-client version 0.17.0
Additional context
I think the correct fix ought to be to fall back to JSON parsing in the event of YAML parsing failure (or else a flag to specify?). I'm not sure why the mimetype isn't being guessed right
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 il comando segnalato con l’URL JSON OpenAPI collegata e analizza il percorso di caricamento e parsing della sorgente che gestisce la relativa risposta text/plain. Il lavoro è completato quando il client genera correttamente a partire da questo URL e il comportamento di fallback è coperto da un test di regressione.
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
- 35/100