Skip to content

wso2api: openapi-spec examples are modified before uploaded to WSO2 #73

@MichielVrins

Description

@MichielVrins

What's broken?

The uploaded openapi spec to WSO2 is not the same as the one generated during cdk synth. Specifically, boolean values in the example of an api get converted to a string e.g. true becomes "true".

Version used

0.19.1-beta.0
0.16.0

Context

During synthesis an openapi spec is generated. This has the correct specification + example. During deployment the Lambda logs the openapi spec again. This then contains the booleans converted to a string.

From a chat with @MarcioMeier we already figured out that this does not seem to happen for all cases. But the following schema causes this issue for us.

export const responseBodySchema = z
  .object({
    data: z.object({
      var1: z.boolean().optional(),
      var2: z.boolean().optional(),
    }),
    status: z.enum(['success']),
  })
  .openapi({
    example: {
      data: {
        var1: true,
        var2: false,
      },
      status: 'success',
    },
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions