Update to orval version 8.5.x#112
Conversation
764a1d0 to
241ec43
Compare
| "200": { | ||
| "description": "Item retrieved successfully" | ||
| } | ||
| }, |
There was a problem hiding this comment.
This was failing the validation because of following, hence updated
- "Property headers is not expected to be here" at /paths/~1items-header/get
In OpenAPI 3.x, operation-level headers are not expressed as a top-level headers array.
They must be under parameters with "in": "header".
Main’s schema has a custom headers array next to parameters, which the validator rejects.
- "oneOf must match exactly one schema in oneOf" at /paths/~1items-header/get/requestBody
Main’s schema has "requestBody": { "required": false }.
A valid requestBody must describe content (e.g. with content) or match the expected schema shape; this fragment is invalid and triggers the oneOf validation error.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65607e3414
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Array.isArray(schema.examples) && | ||
| schema.examples.length > 0 | ||
| ) { | ||
| return `'${schema.examples[0]}'` |
There was a problem hiding this comment.
Keep schema
examples values in their original type
getExampleValueForSchema now returns '${schema.examples[0]}' whenever a schema has an examples array, which forces every example into a string literal. For OpenAPI 3.1 specs with numeric/boolean/object examples, the generated sample script now uses incorrect types (and object examples become '[object Object]'), so request bodies and params no longer match the schema. This is a regression introduced by the new examples branch.
Useful? React with 👍 / 👎.
Update to the orval version 8.5.1 which had some breaking changes.
Changes in the
examplesdirectory can be ignored as they are just formatting changes.