openapi-generators / openapi-generators/openapi-python-client

Generator fails on OAuth2PasswordRequestForm contents

Offen
#855 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
2k
Forks
293
Ø Merge
34 Min.
Gemergte PRs (30 T.)
1

Beschreibung

Describe the bug
The generator reports validation errors on regarding the OAuth2PasswordRequestForm type:

components.schemas.Body_login_auth_login_post.Reference.$ref
  Field required [type=missing, input_value={'properties': {'grant_ty..._login_auth_login_post'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.grant_type.Reference.$ref
  Field required [type=missing, input_value={'anyOf': [{'type': 'stri..., 'title': 'Grant Type'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.grant_type.Schema.anyOf.1.Reference.$ref
  Field required [type=missing, input_value={'type': 'null'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.grant_type.Schema.anyOf.1.Schema.type
  Input should be 'string','number','integer','boolean','array' or 'object' [type=enum, input_value='null', input_type=str]
components.schemas.Body_login_auth_login_post.Schema.properties.client_id.Reference.$ref
  Field required [type=missing, input_value={'anyOf': [{'type': 'stri...], 'title': 'Client Id'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.client_id.Schema.anyOf.1.Reference.$ref
  Field required [type=missing, input_value={'type': 'null'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.client_id.Schema.anyOf.1.Schema.type
  Input should be 'string','number','integer','boolean','array' or 'object' [type=enum, input_value='null', input_type=str]
components.schemas.Body_login_auth_login_post.Schema.properties.client_secret.Reference.$ref
  Field required [type=missing, input_value={'anyOf': [{'type': 'stri...title': 'Client Secret'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.client_secret.Schema.anyOf.1.Reference.$ref
  Field required [type=missing, input_value={'type': 'null'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.3/v/missing
components.schemas.Body_login_auth_login_post.Schema.properties.client_secret.Schema.anyOf.1.Schema.type
  Input should be 'string','number','integer','boolean','array' or 'object' [type=enum, input_value='null', input_type=str]

OpenAPI Spec File
Example File: https://raw.githubusercontent.com/stustapay/stustapay/2812c74c622b11c2aa95d0f59933815c0daca4ed/api/administration.json

Desktop (please complete the following information):

  • OS: Fedora Linux 38
  • Python Version: 3.11.4
  • openapi-python-client version: 0.15.1

Additional context
Probably because of FastAPI 3.1.0 https://github.com/openapi-generators/openapi-python-client/discussions/818

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Validierungsfehler des Generators mit der verknüpften administration.json OpenAPI-Spezifikation zu reproduzieren, wobei der Fokus auf den Feldern von OAuth2PasswordRequestForm und deren nullable Schemas liegt. Als abgeschlossen gilt die Aufgabe, wenn der Generator diese Spezifikation ohne Validierungsfehler akzeptiert und ein gültiges Client-Schema erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
fastapi, python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.