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
I have searched existing issues to ensure the issue has not already been raised
Issue
When validating non-file fields in the body and NOT using the shared schema, according to the plugin documentation, we can validate the fields by using the following syntax:
and therefore the validation schema on top (from the plugin docs) makes sense.
However, the problem is that this conversion is not mentioned anywhere in the documentation and it's just really confusing and leads to issues like this: fastify/help#525 (comment)
I would suggest to mention the conversion which would explain why is the validation schema defined like it is.
The text was updated successfully, but these errors were encountered:
…280)
* Updated README.md with relevant information about the sharedSchemaId. #276
* Improve docs: added more details on field conversion [#277]
* Fixed typo
* Added an example for the non-file field validation
* Apply suggestions from code review
Minor styling changes on the text.
Co-authored-by: Manuel Spigolon <[email protected]>
* Minor wording update
Co-authored-by: Manuel Spigolon <[email protected]>
Prerequisites
Issue
When validating non-file fields in the body and NOT using the shared schema, according to the plugin documentation, we can validate the fields by using the following syntax:
However one would expect that for the non-file fields (like this for example:
{ "hello": "world"}
) the JSON schema for validation would be:just like it's mentioned in the fastify docs.
However, the plugin converts the non-file fields from this:
to this:
and therefore the validation schema on top (from the plugin docs) makes sense.
However, the problem is that this conversion is not mentioned anywhere in the documentation and it's just really confusing and leads to issues like this: fastify/help#525 (comment)
I would suggest to mention the conversion which would explain why is the validation schema defined like it is.
The text was updated successfully, but these errors were encountered: