#nestjs swagger ApiPropertyOptional option

1 messages · Page 1 of 1 (latest)

fading drum
#

hi
i want to hide this variable in my swagger. but it show!
how can i hide it?

  @ApiPropertyOptional({
    type: [ListAnnotationResponseItem],
  })
  @Type(() => ListAnnotationResponseItem)
  @IsUrl()
  @IsOptional()
  @Expose()
  annotations?: ListAnnotationResponseItem[];

swagger response

#

and i want to show query parameter example case in gray color(just show up example, not put in there)

cobalt yacht
#

The example payload always contains all props, even optional ones. If you switch the view to 'schema', you'll see which ones are optional and which ones are required

#

If you want to hide the prop complemetly, use ApiHidePriperty