Incorrect / misleading error information provided when validating request body
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, openapi, typescript
- Área
- backend-api-design
Línea de trabajo
Start with the linked example repository: run npm ci and npm run test as described, then inspect api.test.ts and its failing validation cases. Trace how the project validates request bodies against shared Datum schemas and constructs instancePath, schemaPath, and the errors array. Done means failures identify the correct fields and multiple invalid fields produce separate errors.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version: 5.10.6
Scenario:
- The OpenAPI spec denotes a
requestBodywith multiple composite "datum" fields that have a commonDatumschema also defined in the OpenAPI spec (there are three of these in my example). - The
Datumschema has fieldsvalue(of typenumber) andunit(of type enum defined in the OpenAPI spec). - The example repo for this is here: https://github.com/markgreenwood/openapi-backend-validation-bug
Expected behavior:
- A composite field that fails to validate should report an error with
instancePathandschemaPaththat both reflect that field's identity (i.e. contain the name of the invalid field). - If multiple fields fail validation, there should be multiple errors that each contain the information described above.
Actual behavior:
- If any fields using the
Datumschema OTHER than the first one in the spec are provided non-numeric values, the error'sschemaPathreports validation failure with the name of the FIRST field listed that uses theDatumschema, not the one that actually failed validation. (In the example, ifweightis provided a non-numeric value, theschemaPathincorrectly reportsdistanceas the culprit that failed validation.) - If multiple fields fail validation, the errors array only contains one error, not all the ones that failed to validate. (In one of the example tests, both
weightandtemperatureare provided non-numeric values, but only one error is reported and itsschemaPathincorrectly reportsdistanceas being invalid.)
Steps to reproduce:
- Clone or fork the example repo, install dependencies with
npm ci, and then runapi.test.tsusingnpm run test. Two of the tests describing the expected behavior above should fail.
- Lenguaje dominante
- TypeScript
- Estrellas
- 689
- Forks
- 97
- Merge medio
- 2 h 36 min
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openapistack/openapi-backend
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
openapistack/openapi-backend#1046 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
openapistack/openapi-backend#1047 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 44/100
openapistack/openapi-backend#860 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
openapistack/openapi-backend#814 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
openapistack/openapi-backend#809 ·
Los mantenedores suelen responder en 1 día
Todos los issues de openapistack/openapi-backend
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
marimo-team/marimo#11768 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue priority: high size: XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openclaw/openclaw#195577 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Studio feedback] 对话内容向下滚动时执行过程吸顶时,由于背景色是透明的,导致执行过程标题与下面的具体执行内容重叠,导致了两行信息重叠显示;建议执行过程的背景色设置为会话界面的背景Abiertobug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
esengine/DeepSeek-Reasonix#15044 ·
Los mantenedores suelen responder en 1 día
-
Web wizard: "Launch without Sandbox" can switch a Structured create to Terminal in the same clickAbiertoarea:web bug needs-triage P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-of-empires/agent-of-empires#5489 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día