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 bug has not already been reported
Fastify version
3.27.2, 4.0.0-alpha.1
Node.js version
14.19
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Arch Linux
Description
Hi,
I'm using fastify with a response schema. In the schema I've a property called user, which can be null or a object with id and email.
When the user object has the properties id and email everything works as expected. If the object contains an additional property, the whole user object is converted to null in the response. This was somehow unexpected, but I'm not sure if this is really a bug.
Additional properties in the user object should be removed instead of setting the object to null. This would mirror the behavior for other additional properties. additionalProp is removed from the output.
Prerequisites
Fastify version
3.27.2, 4.0.0-alpha.1
Node.js version
14.19
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Arch Linux
Description
Hi,
I'm using fastify with a response schema. In the schema I've a property called user, which can be
null
or a object withid
andemail
.When the user object has the properties
id
andemail
everything works as expected. If the object contains an additional property, the whole user object is converted tonull
in the response. This was somehow unexpected, but I'm not sure if this is really a bug.Steps to Reproduce
Expected Behavior
Additional properties in the user object should be removed instead of setting the object to
null
. This would mirror the behavior for other additional properties.additionalProp
is removed from the output.The following code
should return
following is returned
The text was updated successfully, but these errors were encountered: