Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Response schema validation message is not clear for arrays

Aperta
#128 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
openapi, python
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
368
Fork
140
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-openapi/openapi-core

Tutte le issue di python-openapi/openapi-core

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.