Closed adrian-gierakowski closed 1 month ago
btw. Schema.optional
seems to be ok when used in body
Try Schema.optional(..., { exact: true })
, I believe this was already discussed in the past, the problem is that with Schema.optional
you're also allowing the undefined
value which is not representable in the JSON.
Thanks, that worked. Although I wonder why optional
works for body though?
So in the end, the openapi logic is handling this case already (I honestly forgot about it) but it's not handled for query parameters / path parameters / headers. Fix prepared.
Hey, is it resolved for you?
minimal example:
when ran, logs:
removing
optionalParam
makes the first log line disappear