See specification for Data Types
Primitives have an optional modifier property: format
This would be very usefull for Date as it will be transported as "string".
So please add format property to ApiModelProperty.
Example class:
class Event {
@ApiModelProperty({ format: 'password' })
mySecret: string;
@ApiModelProperty()
myDate: Date;
}
should generate:
"definitions": {
"Event": {
"type": "object",
"properties": {
"mySecret": { "type": "string", "format": "password" },
"myDate": { "type": "string", "format": "date-time" } // Date schould get this format by default
}
}
}
This would indeed be very useful to bring to the project.
@kamilmysliwiec By the way, thank you so much for your efforts and keep up the good work !!
Format property will be available in the incoming release 馃憤
@ApiModelProperty({ type: Date, format: 'date-time'}) still generate Object !
@xmlking try to use
@ApiModelProperty({type: 'string', format: 'date-time'})
dateField: Date;
this works for me.
@ApiModelProperty({ type: 'string', format: 'date-time', example: '2018-11-21T06:20:32.232Z' })
@CreateDateColumn({ type: 'timestamptz' })
createdAt?: Date;
How can I apply this to query string parameters? Here I have the same problem:

... so how can I change this to type=string, format=date?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@xmlking try to use
@ApiModelProperty({type: 'string', format: 'date-time'}) dateField: Date;