At first it seems like types are correct but when trying to narrow the block type inside a switch statement by field "type" it is impossible since each block is not strictly connected to its "type" field.
An example:
switch (block.type) {
case FrontofficePageBlockSharedTypeEnum.COURSE_LISTING:
// typescript doesn't recognize this as FrontofficePageBlockCourseListingBlock but as FrontofficePageBlock
...
break
case FrontofficePageBlockSharedTypeEnum.LINK_WITH_ICON_LIST:
// typescript doesn't recognize this as FrontofficePageBlockLinkWithIconBlockList but as FrontofficePageBlock
...
break
}
It seems like the generator is ignoring the discriminator field from open api schema.
Description
Given this OpenApi schema yaml
I would expect the generated types to look like this
but this is what we are getting
At first it seems like types are correct but when trying to narrow the block type inside a switch statement by field "type" it is impossible since each block is not strictly connected to its "type" field.
An example:
It seems like the generator is ignoring the discriminator field from open api schema.
Reproducible example or configuration
https://stackblitz.com/edit/hey-api-client-fetch-example-emxls6?file=src%2FApp.tsx
OpenAPI specification (optional)
System information (optional)
No response