Wildcard content-type "*/*" leads to unparsed JSON responses

Aperta
#418 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

The bug is that a response declared with the wildcard content-type */* is not parsed, so an object schema fails against a String body. Start where the response parser is chosen from the OAD's response content-type, and check how the wildcard is handled there. Done means a */* response with type: object gets its body parsed and validates. The issue has been open for about a year with one comment and no answer, so confirm the expected behaviour with the maintainer first.

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

Descrizione

Currently openapi_first picks a response parser based on the content-type defined in your OAD. If you specify a content-type like application/json: your response will be parsed with JSON.

When your OAD has a response content-type specified like */* openapi_first current does not parse the response body at all and just returns the plain body (as a String).

This leads to having a response definition like this always failing validation, because a the string (String) is not an object (Hash):

          content:
            "*/*":
              schema:
                type: object
Lingua principale
Ruby
Stelle
222
Fork
27
Merge medio
17h 15m
PR unite (30g)
6

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna 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 ahx/openapi_first

Tutte le issue di ahx/openapi_first

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.