Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
raphaelsolarski opened this issue Aug 30, 2023 · 0 comments
Labels

Comments

@raphaelsolarski
Copy link
Contributor

raphaelsolarski commented Aug 30, 2023

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 raphaelsolarski changed the title OpenAPI - Dealing with nested optional fields requires conversion to Unknown OpenAPI - Omiting nested optional fields requires conversion to Unknown of parent record Aug 30, 2023
@raphaelsolarski raphaelsolarski changed the title OpenAPI - Omiting nested optional fields requires conversion to Unknown of parent record OpenAPI - Omitting nested optional fields in request requires conversion to Unknown of parent record Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant