#Swagger : document not rendering dto properties correctly

4 messages · Page 1 of 1 (latest)

chrome matrix
#

Hey, I've been messing around with Nest recently, for a project.
I've been trying to generate a swagger document using nest's document builder.
My main issue RN is that the types of the properties need to be unfolded, which is quite odd (?)

export class User {
  id: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty()
  name: string;

  @IsEmail()
  @IsNotEmpty()
  @ApiProperty()
  email: string;

  @IsNotEmpty()
  @ApiProperty()
  password: string;
}

I've tried strongly typing it in the ApiProperty using ```ts
@ApiProperty({ type: String })


I'm just wondering where this could come from, could anyone help me w/ this?
stuck creek
chrome matrix
stuck creek
#

Do you mean why a primitive type like string has a collapse arrow button next to it when it shouldn't? Well, that's just a thing with swagger ui rendering and isn't related to nestjs.