You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project uses ts-rs to take rust objects, and generate typescript types, to be used for an API client.
While the types are nice to have, I'd also like to be able to use tsoa to build an OpenAPI spec.
All was going well until I tried to use my form in a Get :
/** * List all the media for your user * * `HTTP.GET /account/list_media` */
@Get("/account/list_media")listMedia(
@Queries()form: ListMedia={},
@Inject()options?: RequestOptions,){returnthis.#wrapper<ListMedia,ListMediaResponse>(HttpType.Get,"/account/list_media",form,options,);}
And got this error:
GenerateMetadataError: @Queries('form') only support 'refObject' or 'nestedObjectLiteral' types. If you want only one query parameter, please use the '@Query' decorator.
Turns out, tsoa only supports interfaces, and not types, even though they are trivially the same:
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.// Doesn't workexporttypeListMedia={page?: number;limit?: number};// WorksexportinterfaceListMedia{page?: number;limit?: number;}
The strangest part about this, is that the return types (which are also all type), and @Body() seem to work perfectly fine. Only the Queries() doesn't work.
The text was updated successfully, but these errors were encountered:
My project uses ts-rs to take rust objects, and generate typescript types, to be used for an API client.
While the types are nice to have, I'd also like to be able to use
tsoa
to build an OpenAPI spec.All was going well until I tried to use my form in a
Get
:And got this error:
GenerateMetadataError: @Queries('form') only support 'refObject' or 'nestedObjectLiteral' types. If you want only one query parameter, please use the '@Query' decorator.
Turns out,
tsoa
only supports interfaces, and not types, even though they are trivially the same:The strangest part about this, is that the return types (which are also all
type
), and@Body()
seem to work perfectly fine. Only theQueries()
doesn't work.The text was updated successfully, but these errors were encountered: