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
strictSchema is set to false in the ajv options (and overrides any user-provided ajv: options to the constructor, so it cannot be set to true by the user either).
This makes it very easily to add a schema with an error that is silently ignored.
In my case I made a typo with additionalProperties in a fastify response schema, which meant that additional properties were not removed from a response on serialisation that should have been.
It would seem like having strictSchema:true would be a better default? (which would be a breaking change needing a major version I suppose), or at least allow the user to set this.
I tested setting strictSchema:true and running the tests, and the only additional keyword used internally seems to be kind1,2, which is only used in tests.
The text was updated successfully, but these errors were encountered:
Prerequisites
Issue
strictSchema
is set to false in the ajv options (and overrides any user-providedajv:
options to the constructor, so it cannot be set to true by the user either).This makes it very easily to add a schema with an error that is silently ignored.
In my case I made a typo with
additionalProperties
in a fastify response schema, which meant that additional properties were not removed from a response on serialisation that should have been.It would seem like having strictSchema:true would be a better default? (which would be a breaking change needing a major version I suppose), or at least allow the user to set this.
I tested setting
strictSchema:true
and running the tests, and the only additional keyword used internally seems to bekind
1,2, which is only used in tests.The text was updated successfully, but these errors were encountered: