Closed esatterwhite closed 1 year ago
hey @esatterwhite thank you for reporting this. Would you like to contribute and add a test in the ObjectSchma.test.js file and add the functionality if it fails?
I don't particularly have time for it
@aboutlo looks like a fix for 5his landed, can we get a new release?
Prerequisites
Fastify version
4.10.2
Plugin version
No response
Node.js version
16.14.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
5.10.167-1-MANJARO
Description
I think there is a problem with using ref + raw in the object schema in that the values added by the
raw()
function are removed or not includedSteps to Reproduce
correct
incorrect
I suspect it is from the object schemas handling of ref
https://github.com/fastify/fluent-json-schema/blob/ab242d2a88973c78365a042fc2e9568208a28872/src/ObjectSchema.js#L321-L331
Expected Behavior
I'd expect the properties defiend by
.raw()
to be carried unconditionally to the object they are defined