Closed Hi-Fi closed 6 months ago
Hi @Hi-Fi, thank you for reaching out. Unfortunately, I am not able to reproduce the issue you addressed above with the latest version of the package. Can you try to use the latest version (v3.39.0)?
Sorry, example was a bit bad. Here's complete one that shows error.
index.ts
import {
Controller,
Post,
Route,
SuccessResponse,
} from '@tsoa/runtime';
import * as CodeBuild from '@aws-sdk/client-codebuild';
@Route('health')
export class ExampleController extends Controller {
@SuccessResponse(200, 'Returns test')
@Post()
public async health (): Promise<CodeBuild.Report> {
return {} as CodeBuild.Report;
}
}
tsoa.json
{
"entryFile": "./index.ts",
"noImplicitAdditionalProperties": "throw-on-extras",
"spec": {
"outputDirectory": "apimodel",
"specFileBaseName": "apispec",
"host": "example.com",
"basePath": "/example",
"yaml": true,
"specVersion": 3
}
}
Those file in same directory commands that show error (run in same dir as files)
npm i @aws-sdk/client-codebuild
npx tsoa spec
As mentioned issue at TSOA side is also open, but also here as types have changed between aws-sdk v2 and v3.
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Describe the bug
When generating API model with TSOA, generation fails as undefined is not valid value for OpenAPI (see https://github.com/lukeautry/tsoa/issues/891
Your environment
SDK version number
@aws-sdk/client-codebuild@3.38.0
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
Node v16.11.0
Steps to reproduce
Model including following (used) model:
Observed behavior
TSOA throws error. There's also issue related to that in TSOA tracker (https://github.com/lukeautry/tsoa/issues/1031), but this apispec cretion worked fine with AWS-SDK v2 as model had just normal mandatory values (https://github.com/aws/aws-sdk-js/blob/af5475f66c30b32ac03882393b0508dd4fedb3e5/clients/codebuild.d.ts#L2722-L2735 vs. https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-codebuild/src/models/models_0.ts#L3594-L3612).
Expected behavior
Apispec is generated successfully. If undefined is valid value, those are marked as optional in model so apispec can be generated.