All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- fix
IsAlphanumeric
class-validator #56 - fix ApiProperty annotations: special strings, e.g. date strings, have not been parsed correctly #58
- support new decorators introduced in [email protected] #53
- fix
nullable
in@ApiProperty
for fields with default value in CreateDto
- add
outputApiPropertyType
flag to solve issues with SWC #39 (thanks to KoenLemmen) - add
generateFileTypes
config to generate only DTO files, only Entity files, or both #42
- fix wrong class-validator decorator on disconnect property #44
- add
@DtoUpdateRequired
annotation #40 (thanks to KoenLemmen)
- fix missing lazy resolver for complex types #39
- add
@DtoConnectHidden
annotation #28
type
in@ApiProperty
is now always explicitly set #38
- support
@ValidateIf()
decorator - add
@DtoCreateValidateIf(...)
and@DtoUpdateValidateIf(...)
decorators #36 #37 (thanks to iamciroja)
- fix CreateDto/UpdateDto on nullable Json fields: use
Prisma.NullableJsonNullValueInput
instead ofnull
- fix ApiProperty type in ConnectDto if field is JsonValue
- updated prettier and eslint
- add lazy resolver for complex types to avoid circular dependency issues #31
- support
[]
characters in@DtoCastType()
annotation
- prevent double type field in api properties #29
- add
@DtoCreateHidden
and@DtoUpdateHidden
annotation #21 - add
@DtoApiHidden
annotation to add@ApiHideProperty
decorator #23 - add
DtoRelationCanDisconnectOnUpdate
annotation #25 (thanks to @m1212e)
- Use default ApiProperty required behavior #18. Use
requiredResponseApiProperty = "false"
parameter for the old behavior. - create a combined index.ts in root output folder #22
- upgrade to [email protected] now parses triple-slash comments on composite types
- add type to @ApiProperty if field is a list #20
- fix connect and create class names that get too many suffixes if
dtoSuffix
does not end withdto
#17
- fix namespaced imports with
@DtoCastType
annotation #16
- prisma imports for ConnectDTOs
- support custom prisma-client import path #15 (thanks to konsti)
definiteAssignmentAssertion
flag to optionally add definite assignment assertion operator!
to properties #14- support for compound unique inputs #i8, all ConnectDTOs now have proper swagger and class-validation decorators
- regular expression for class validators was also matching substrings
@DtoCastType
annotation #12 (thanks to zackdotcomputer)
- updated dependencies #11
replaceAll
is not supported by Node.js < 15 #10
- add ApiProperty type and class validation to relation inputs #6
- add
isArray: true
in ApiProperty decorator, if field is list - build dist files with LF endings #9
- support for composite types (including nested class validation) #2
@DtoTypeFullUpdate
annotation #2- optionally auto-format output with prettier #3 (thanks to @Zyrakia)
- set
@ApiProperty({ required: false, nullable: true }
if field is optional - add
{ each: true }
class-validator option if field is a list - class-validator
@IsDateString()
for typeDateTime
and@IsDecimal
for typeDecimal
@DtoTypeFullUpdate
annotation #2
- optional fields can be
null
onlyUpdateDTO
- optional fields can be
null
inCreateDTO
andUpdateDTO
- support for composite types (including nested class validation) #2
- set
@ApiProperty({ required: false, nullable: true }
if field is optional - add
{ each: true }
class-validator option if field is a list
@DtoRelationIncludeId
annotation: relation IDs are omitted by default, but can be forced to be included in the DTOs
- removed class validator
@IsJSON()
fromCreateDTO
andUpdateDTO
for fields withJson
type, because request body is already parsed and the respective property is not a JSON string anymore
- if entity prefix/suffix is specified, relation input DTOs are named incorrectly (occurs if tags like @DtoRelationCanConnectOnCreate are used)
- escape aposthrophe
'
with\'
, otherwise string generation breaks
- field with attribute
@default("")
resulted in emptydefault
value:@Apiproperty({ default: })'
- parsed apiProperties were propagated to other DTOs
- optionally add validation decorators from
class-validator
- config
outputType
to generate DTOs asclass
or asinterface
- missing import of
ApiProperty
- flag
flatResourceStructure
to flatten the subfolders ifoutputToNestJsResourceStructure
istrue
- flag
noDependencies
to output DTOs without any imports and decorators from external dependencies (useful to generate DTOs for frontend) @example
annotation adds example to@ApiProperty()
- missing
import
ofApiProperty
if only type-format annotations
- generate plain
DTO
classes (same as entity classes, but without relation fields)
- default values are added to the
@ApiDecorator()
only in theCreateDTO
andUpdateDTO
classes
- omit
@ApiProperty()
annotations for connect-dto classes
- add default value (if any) to
@ApiProperty()
- process additional documentation tags to generate
@ApiProperty()
decorator - translate prisma type to schema object type and format
- upgrades prisma dependencies to their latest 3.x versions
- Generated code imports using \ instead of / (#10)
- upgrades prisma dependencies to their latest 3.x versions
- applies available minor and patch updates to dependencies