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
One of our endpoints receives an array of objects which is wrapped in a data wrapper (see example).
We validate the input with a Laravel Form Request and provide more meaningful description and examples via bodyParameter() method (see below). This leads to an almost perfect OpenAPI Yaml, which we use with the Scalar theme.
Problem: The data property which holds all child objects has an empty array as example value in the OpenAPI spec. If we would remove the example: [] property from the specification, the provided body parameters appear in the example request.
Steps I tried:
I already tried to understand the ParsesValidationRules.php logic which should generate the correct example string, but I don't find an issue.
I already tried to understand the OpenAPISpecWriter.php logic which writes the example.
Scribe version
4.36.0
Your question
One of our endpoints receives an array of objects which is wrapped in a data wrapper (see example).
We validate the input with a Laravel Form Request and provide more meaningful description and examples via
bodyParameter()
method (see below). This leads to an almost perfect OpenAPI Yaml, which we use with the Scalar theme.Problem: The
data
property which holds all child objects has an empty array as example value in the OpenAPI spec. If we would remove theexample: []
property from the specification, the provided body parameters appear in the example request.Steps I tried:
P.S. Kudos to you for providing this awesome dependency! Thank you!
Docs
The text was updated successfully, but these errors were encountered: