nussknacker
nussknacker copied to clipboard
OpenAPI - Omitting nested optional fields in request requires conversion to Unknown of parent record
Currently if we want to invoke service with optional nested field in request body we have to convert the parent record to Unknown (e.g. by using #CONV.toAny(...)
). After such a conversion we lose validation of possible other required fields in the parent record.
Example OpenAPI spec:
openapi: "3.1.0"
info:
title: Simple API overview
version: 2.0.0
paths:
/customer:
post:
requestBody:
content:
application/json:
schema:
type: object
properties:
foo:
type: object
properties:
bar:
type: string
responses:
'200':
description:
Returns ComponentsByAccount.
content:
application/json:
schema:
type: string
Workaround: