The OpenAPI specification is a language-agnostic definition format used to describe RESTful APIs. Nest provides a dedicated module that allows generating such a specification by leveraging decorators.
Questions tagged [nestjs-swagger]
152 questions
0
votes
0 answers
How to read data for the following fields in nestjs/swagger dto .I am new to nestjs ,Any help is appreciated
idProofs = [
{ name: 'PAN Card', number: '22TB12CD', fileName: ['22TB12CD.png', '22TB12CD.png','22TB12CD.png' ] },
{ name: 'Aadhar Card', number: '359821231', fileName: ['359821231.png'] },
{ name: 'Passport', number: 'AT123ZS', fileName:…

Krishna Priya
- 1
- 1
0
votes
1 answer
@nestjs/swagger: Is it possible to prevent phishing?
I'm using @nestjs/swagger in the Nest.js application to generate Swagger documentation.
In the documentation we have a simple example like
const config = new DocumentBuilder()
.setTitle('Cats example')
.setDescription('The cats…

CyberEternal
- 2,259
- 2
- 12
- 31
0
votes
1 answer
Nestjsx/crud api not working properly on existing tables
I build my Nextjs project with nestjsx to create Restful api.
My customer.controller.ts
import { Controller } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Crud, CrudController } from '@nestjsx/crud';
import {…

Tim Woohoo
- 470
- 1
- 7
- 17
0
votes
1 answer
Swagger with NestJS won't attach Bearer token for some endpoints
I have a NestJS controller:
@Controller('users')
@ApiTags('users')
export class UserController {
constructor(
private userService: UserService,
private userRoleService: UserRoleService,
private readonly…

Aleksei Yerokhin
- 869
- 4
- 9
- 22
0
votes
1 answer
Is it possible to dynamically set the parameters of a decorator?
I have several endpoints that allow pagination and return an object containing the paginated items as well as the max number of pages possible. For example, if I have 41 documents and returning 5 documents per page, it would look like:
{
items:…

Cris
- 209
- 2
- 10
0
votes
0 answers
No repository for "ENTITY" found in "XXX" Connection [TypeORM]
I have Settings Module with attendance_record_options subservice.
I am calling routes in settingsController , from there I am calling settingsService which contains object of AttendanceRecordOptionsService (interacts with…

Jamshaid Tariq
- 551
- 1
- 8
- 31
0
votes
2 answers
nestjs/swagger How Do I Change The Default "Username" Field in Basic Auth
@ApiBasicAuth()
@UseGuards(LocalAuthGuard)
@Post('login')
async login(@Request() req) {
return this.authService.login(req.user);
}
When I open up the api docs, the auth for this route shows a "username" and a "password" field.
I want…

Bousha
- 11
- 1
- 3
0
votes
1 answer
TypeOrm Joins without using QueryBuilder
I have 3 tables
attendance
user
attendance_verification.
attendance->ManyToOne->user
attendance->OneToOne->attendanceVerification
now I want to query attendance for a specific user and want to embed complete user and attendanceVerification data in…

Jamshaid Tariq
- 551
- 1
- 8
- 31
0
votes
1 answer
How to generate migration file in typeorm using nest js
I am new this framework Nest JS and created sample Restful API but could not migrate the entity file. I tried many ways it's not working. first time run migration command to generate migration file it's working fine. but second time creating a new…

Hariprasath Vengatachalam
- 155
- 6
- 18
0
votes
1 answer
How to call nestjs microservice from any frontend app?
I have a made a NestJS microservice package and separate NestJS client application for contacting the microservice. Below given is the code used in the client application. In microservice the method used is @messagePattern and it is functional. My…

Ujjual
- 958
- 2
- 10
- 36
0
votes
1 answer
Optional parameter in NestJS Swagger
For an API server, I have a set of models, e.g.
Recording <-> Artist
with ManyToMany relation in TypeORM. The relation needs to be defined in both sides models.
In certain routes I am displaying only Recording and in certain routes also Recordings…

Richard
- 43
- 2
- 8
0
votes
1 answer
Not getting post textarea in swagger js
enter image description here
I have added the below code in main.ts
import { NestFactory } from '@nestjs/core';
import{SwaggerModule,DocumentBuilder} from '@nestjs/swagger'
import { AppModule } from './app.module';
async function bootstrap() {
…

Hitler
- 1
0
votes
1 answer
How to map graphQL query property to different response property?
I have a graphQL type defined in a .graphql file for a nestjs schema first application. The type is:
type address {
id: String
Title: String
Url: String
}
Now, using nestjs I have a resolver function as
@Query('address')
async getAll():…

Ankit Agarwal
- 30,378
- 5
- 37
- 62
0
votes
1 answer
how to customise error message in post request?
I am using nest js for making Restfull Api . I am also using class-validator ,and class-transform to validate my request ot DTO. Currently It is showing this error
{"statusCode":400,"message":["username should not be empty","description should not…

user944513
- 12,247
- 49
- 168
- 318
0
votes
1 answer
How can we add some custom errors (related key) in API docs by using swagger/nestjs?
I am trying to show the error response after success response in API Docs. for example:-
@ApiResponse({status: 401, description: 'invalid_client'}) (it's working)
but I want to give a customCode also like :-
@ApiResponse({status: 401, **customCode…

Shipra Choudhary
- 21
- 1
- 4