@ApiProperty({
required: true
// other properties like description, example etc.
})
required: true is by default in @ApiProperty, no need to override it. It provides unnecessary complexity and it's just a boilerplate. As we already have api-property-matches-property-optionality it would be nice to have something like api-property-no-redundant-required. Or we can expand api-property-matches-property-optionality and add option like "no-redundant-required".
In many codebases I see code like
required: true
is by default in@ApiProperty
, no need to override it. It provides unnecessary complexity and it's just a boilerplate. As we already haveapi-property-matches-property-optionality
it would be nice to have something likeapi-property-no-redundant-required
. Or we can expandapi-property-matches-property-optionality
and add option like "no-redundant-required".WDYT?