tsoa: internal tsoa error: the metadata that was generated should have had nested property schemas since it’s for a nested object,however it did not
Sorting
-
I’m submitting a …
- bug report
- feature request
- support request
-
I confirm that I
- used the search to make sure that a similar issue hasn’t already been submit
Bug
I get the tsoa error mentioned in the titel. It tells me to open a bug report 😉
What I send to the API:
What the API has defined:
export type JobDescriptionInternalBlockType =
| 'intro'
| string;
export interface IAPIJobDescriptionBlock {
language: string; // locale or language
blocks: {
header?: string;
internalName?: JobDescriptionInternalBlockType;
content: string;
}[];
}
export interface TestInputDTO {
descriptionBlocks?: IAPIJobDescriptionBlock
}
The error happens here:
Steps to Reproduce
- Create an interface with A PUT request like:
@Put('/test')
async test(
@Body()
body: TestInputDTO
) {
// something
return true;
}
- Send request to the api
- get error message
Context (Environment)
Version of the library: v2.5.3 Version of NodeJS: v12.6.0
- Confirm you were using yarn not npm: [ ] <-- i’m usign npm
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (11 by maintainers)
@WoH sorry, I didn’t copy your PR properly, it does indeed generate the subschemas now and the error is gone
@simllll the idea for custom transforms sounds fun. Would you mind moving that to a new issue?