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

Abierto
#418 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Ruby
Estrellas
222
Forks
27
Merge medio
17 h 15 min
PR fusionados (30 d)
6

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ahx/openapi_first

Todos los issues de ahx/openapi_first

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.