python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Typescript + NestJs + Class Transformer: How to use generic types in response DTO?
I have multiple endpoints that return a response including pagination details. I would like to use one parent type for the pagination and pass in different data-types for the data param.
I tried the f...
Felix Hagspiel
Votes: 0
Answers: 1
Mongoose id and _id changes the value in response
I am getting different ID value in JSON response when checking variable as id & _id in DTO
CASE I ( using id as variable )
DTO for the response
export class UserDetail {
@Expose( )
...
PRABHAT SINGH RAJPUT
Votes: 0
Answers: 3
How to return an object as error message from DTO in nestjs?
How can I return an object as validation error instead of strings?
We have our own error structure and I could do what I want, using JSON.stringify and JSON.parse, like follows:
import { IsNotEmpty, I...
Miad Abdi
Votes: 0
Answers: 0
map multiple properties to single nested object using typescript and class-transformer
I'm using class-transformer (in nestjs) to convert my database entities into dto types to output from my api.
My database entities look like:
class MyEntity {
id: string;
property1: string;
prop...
deanWombourne
Votes: 0
Answers: 4