-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for index signatures #374
Comments
I'll look into making a PR for this after #385 merges (since that's a big PR with lots of changes. In the meantime, although the swagger output will not contain the correct information, the request validation will ensure that the data is correct. There is an API test that confirms that the following interface actually gets validated. export interface ValidateMapStringToNumber {
[key: string]: number;
} And here's the unit test that proves the validation works as expected: tsoa/tests/integration/express-server.spec.ts Line 479 in a5ee290
So long story short, please continue to use I know it's a bit strange that tsoa's swagger output is separate from it's runtime validation, but that's advantageous because we return nice, human readable output. |
Looking forward for this feature :) |
We need to reopen this to make sure that the case presented by @javichi works: #50 (comment) |
@javichi / @manast-apsis this fix/feature was just released in v2.5.1. Can you let us know how it worked out for you? Side note: we're looking for companies that want to be featured in tsoa's readme: #464 |
Sorry for the delay. I can confirm that all index signatures are generated in v2.5.1. Great work guys! |
Seems like index signatures such as
are not currently supported.
https://www.typescriptlang.org/docs/handbook/advanced-types.html#index-types-and-string-index-signatures
nodes will just show as an empty object in the swagger file.
The text was updated successfully, but these errors were encountered: