tspec
tspec copied to clipboard
If I use 'combined type' to the request, the requestBody isn't generated.
Describe the bug If I use 'combined type' as the request body, the requestBody isn't generated.
To Reproduce I used below source code to reproduce this bug.
type BookRequest =
| {
type: "poem";
}
| {
key: "novel";
};
export type BookApiSpec = Tspec.DefineApiSpec<{
...
paths: {
"/books": {
post: {
...
body: BookRequest;
...
};
};
};
}>;
Steps to reproduce the behavior: npx tspec generate
Expected behavior I've been expected 'requestBody' to generated json file. However, I can't find them at there, please refer to Screenshots section. When I used 'single type', it's working perfectly.
Screenshots
There is no 'requestBody' section.
Desktop (please complete the following information):
- OS: Windows
- Browser edge
- Version N/A
Additional context Add any other context about the problem here.