Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Response schema validation message is not clear for arrays

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

Dieses Issue hat noch niemand übernommen.

Bewertung

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

Rechercherichtung

No source files or tests are named in the issue. Reproduce the response-schema validation with the shown YAML array schema and inspect the validation path that produces “Value id is not of type SchemaType.OBJECT.” Done means the error clearly identifies that the response value should be an array.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/schema kind/bug/confirmed

Use case description.
Inside my schema yaml file I've specified that response from some URL handler would be an array of objects, e.g.:

      responses:
        "200":
          description: An array of provisioned Resource Records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResourceRecord'

I've also described what is ResourceRecord inside the same yaml file

For some reason the code returns an object, not an array
in this case the exception message from OpenAPI framework is a bit strange:

SchemaValidationError: Mimetype invalid: Value id is not of type SchemaType.OBJECT

id from error is the 1st attribute of my object (specified in yaml spec)

What is expected.
The expected error message is to complain that no array specified, array is missed, etc

Vorherrschende Sprache
Python
Sterne
368
Forks
140
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-openapi/openapi-core

Alle Issues in python-openapi/openapi-core

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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