nussknacker icon indicating copy to clipboard operation
nussknacker copied to clipboard

OpenAPI - Omitting nested optional fields in request requires conversion to Unknown of parent record

Open raphaelsolarski opened this issue 1 year ago • 0 comments

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

Screenshot 2023-08-30 at 15 21 20 Workaround: Screenshot 2023-08-30 at 15 21 43

raphaelsolarski avatar Aug 30 '23 14:08 raphaelsolarski