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

Unable to process schema when title is ambiguous

Offen
#1,355 0 Kommentare 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

Unable to process schema /components/schemas/ActualApprovement:

Could not find reference in parsed models or enums

Failure to process schema has resulted in the removal of:
/components/schemas/ActualApprovement

Reference(ref='#/components/schemas/backend__server__src__models__types__approvement__ApprovementStatus')

OpenAPI Spec File
A link to an OpenAPI document which produces this issue. Ideally, write a minimal reproduction only containing the problematic pieces.

{
  "components": {
    "schemas": {
      "backend__gateways__types__ApprovementStatus": {
        "type": "string",
        "enum": [
          "in_progress",
          "suspended",
          "rejected",
          "closed"
        ],
        "title": "ApprovementStatus"
      },
      "backend__server__src__models__types__approvement__ApprovementStatus": {
        "type": "string",
        "enum": [
          "pending",
          "approved",
          "rejected",
          "cancelled"
        ],
        "title": "ApprovementStatus"
      },
"ActualApprovement": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/backend__server__src__models__types__approvement__ApprovementStatus"
          }
        },
        "type": "object",
        "required": [
          "status",
        ],
        "title": "ActualApprovement"
      },
}}}

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Python Version: 3.9
  • openapi-python-client version 0.27.1

Additional context
Add any other context about the problem here.

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, den Fehler mit dem OpenAPI-Dokument aus dem Issue zu reproduzieren, wobei du dich auf das Parsen von Schemas und die Referenzauflösung für die beiden Schemas konzentrierst, die den Titel "ApprovementStatus" teilen. Die Aufgabe ist abgeschlossen, wenn das referenzierte Enum korrekt aufgelöst wird und das ActualApprovement-Schema nicht entfernt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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