flaviostutz / flaviostutz/cdk-practical-constructs
wso2api: openapi-spec examples are modified before uploaded to WSO2
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
## 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.
```typescript
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',
},
});
```
Contributor guide
Assessment
This issue has not been assessed yet.