Questions tagged [tsoa]

36 questions
1
vote
0 answers

using tsoa and swagger-ui, how to generate static path url segments

I am using tsoa and swagger-ui in a node-ts application and it's generating the swagger doc accordingly. Instead of generating paths relative to the root ie: http://localhost:3000/pets I want to include some static path in front of the controller…
Griff
  • 1,796
  • 3
  • 23
  • 48
1
vote
0 answers

TSOA swagger can't generate open api

Please help me with this issue. When running tsoa sagger I am getting following error There was a problem resolving type of 'Restaurant'. This error occurs only when I extend base entity and make abstract class that I am implementing on restaurant…
Zlatan Bekric
  • 31
  • 2
  • 6
1
vote
1 answer

Get keys from interface in a generic function

I need to get types from an interface by doing something like below, but I need to do it inside a function. Is there any way to do this using typescript generics? I need the function to pass request bodies, along with an interface specifying their…
t348575
  • 674
  • 8
  • 19
1
vote
2 answers

uploading files - nodejs with typescript and tsoa and swagger

I build a web api with nodejs and express. I used tsoa to generate my routes and a swagger.json file. I want to be able to upload files via the swagger landing page. I followed the instructions on this page:…
Jiren
  • 536
  • 7
  • 24
0
votes
0 answers

Problem of session regeneration on express-tsoa w/ express-session

I am trying to migrate my express application to tsoa and I was using express-session originally for authentication purpose. I am doing some testing on the compatibility but I found that it seems like there are some issue when I try to regenerate a…
Thomas
  • 41
  • 2
0
votes
0 answers

Obtain original ip/host that send request

I am trying to divine what ip or hostname a request originated from, is that something that can be made available in the controller so I can log it? public async endpoint( @Request() request: any, ): Promise { …
aggaton
  • 3,066
  • 2
  • 25
  • 36
0
votes
1 answer

How to use tsoa with express

In express.js I have controller defined like this: @Route('notes') export default class NoteController extends Controller { @Get('/') public async (req: Request, res: Response, _next: NextFunction): Promise => { try { …
Gardelin
  • 950
  • 11
  • 30
0
votes
1 answer

TSOA How to save login/reg body's token as a header for all other requests

I want to save the token which comes from my login or register response body, and use it on all my other requests without copy pasting it into every request header param, is that possible? (I'm using swagger to test it) The documentation is really…
Sweet
  • 1
  • 1
0
votes
1 answer

TSOA @UploadedFile won't accept file

I have an endpoint defined to accept a multipart/form-data file like so: @Post('/...') @SuccessResponse(202, 'Accepted') @Response(400, 'Bad request') @Response(404, 'Not found') public async acceptFile( @UploadedFile('file') file:…
Gtomika
  • 845
  • 7
  • 24
0
votes
1 answer

express TSOA + passport

I'm trying to migrate a custom based controller API based on express to TSOA framework. I was using passport to handle authentication before. How can I use it with TSOA? It seems to be ignored.
Matteo
  • 57
  • 1
  • 9
0
votes
1 answer

How to return the fields defined by the interface not by the mongoose schema

How can I return "id" insted of "_id" and without "__v" to the client with express, mongoose and TypeScript? My code below: Interface export default interface Domain { name: string; objects: DomainObject[] } Creation Interface export default…
g_m
  • 456
  • 1
  • 3
  • 12
0
votes
1 answer

tsoa typescript empty array in response in postman

i have created crud with tsoa typescript but when i request any http request i get an empty array and of course i added data to table livraison in mongodb This is my model.ts export interface ILivraison extends Document { code: String; …
0
votes
1 answer

Custom HTTP status codes in tsoa or any alternative

Is it possible to somehow return custom status codes (eg 600) with TSOA? This was possible in the past (v3.5.2), but isn't anymore with the latest versions. I imagine this is unexpected behavior, since TSOA is implementing the OpenAPI specification…
Raphael
  • 19
  • 4
0
votes
0 answers

Node.js - using tsoa or express to build REST API

I need to choose the architecture of the new nodejs project. This will be a REST API server with WebSockets. Do you know any pros and cons o using this two libraries? tsoa vs express? Express is more common and stable library (I think). With tsoa I…
ppiatek
  • 69
  • 1
  • 5
0
votes
0 answers

Making custom Header request to be required

I have a tsoa request, where I'm trying to include a custom required header, but it can only be added as optional like this. @Header('X-Correlation-Id') correlationId?: string I really would like it to be required, is there away to achieve…
JonB
  • 804
  • 3
  • 12
  • 40