Skip to content

Instantly share code, notes, and snippets.

@MichaelMarner
Last active October 3, 2023 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelMarner/1696ba2b7b97b8c8cb85289b191de222 to your computer and use it in GitHub Desktop.
Save MichaelMarner/1696ba2b7b97b8c8cb85289b191de222 to your computer and use it in GitHub Desktop.
nullable example DTO
export class NestedTypeDto {
@ApiProperty({
type: string
})
value: string;
}
export class SampleDto {
@ApiProperty({
type: NestedTypeDto,
required: true,
})
propertyWorksCorrectly: NestedTypeDto;
@ApiProperty({
type: NestedTypeDto,
required: true,
nullable: false,
})
wrappedInAllOf: NestedTypeDto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment