You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything works well in URL params, query params and other schemas that cannot be recursively nested, but when it comes to the request body, transformation is only performed at the top level of the schema. Examples for each individual field are not transformed at all and stay in the original array form, which is in fact not compliant with the OpenAPI standard.
The impact of this issue is that it breaks various related tooling. Two downstream issues that I encountered were:
Scalar swagger editor currently cannot interpolate examples in request body
Prerequisites
Fastify version
4.24.3
Plugin version
8.12.1
Node.js version
21.3.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Sonoma 14.1.1
Description
Fastify requires
examples
field to be an array of values, which are subsequently transformed into valid OpenAPI format.Everything works well in URL params, query params and other schemas that cannot be recursively nested, but when it comes to the request body, transformation is only performed at the top level of the schema. Examples for each individual field are not transformed at all and stay in the original array form, which is in fact not compliant with the OpenAPI standard.
The impact of this issue is that it breaks various related tooling. Two downstream issues that I encountered were:
orval
fails schema validationExample endpoint:
Output:
Steps to Reproduce
fastify-swagger
inopenapi
modeExpected Behavior
Current implementation of
schemaToMedia
is sufficient, however it should be called recursively for each of theproperties
in the request body.The text was updated successfully, but these errors were encountered: