Docs: Add ApiProperty to all Dtos

This makes it possible for the autogenerated openapi file to contain all the dtos instead of nothing.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-03-19 12:08:34 +01:00
parent 254501d3e5
commit 3620416ed6
14 changed files with 95 additions and 7 deletions

View file

@ -6,6 +6,7 @@
import { IsDate, IsNumber, IsString, Min } from 'class-validator';
import { UserInfoDto } from '../users/user-info.dto';
import { ApiProperty } from '@nestjs/swagger';
export class NoteAuthorshipDto {
/**
@ -13,6 +14,7 @@ export class NoteAuthorshipDto {
* @example "john.smith"
*/
@IsString()
@ApiProperty()
userName: UserInfoDto['userName'];
/**
@ -21,6 +23,7 @@ export class NoteAuthorshipDto {
*/
@IsNumber()
@Min(0)
@ApiProperty()
startPos: number;
/**
@ -30,6 +33,7 @@ export class NoteAuthorshipDto {
*/
@IsNumber()
@Min(0)
@ApiProperty()
endPos: number;
/**
@ -37,6 +41,7 @@ export class NoteAuthorshipDto {
* @example "2020-12-01 12:23:34"
*/
@IsDate()
@ApiProperty()
createdAt: Date;
/**
@ -44,5 +49,6 @@ export class NoteAuthorshipDto {
* @example "2020-12-01 12:23:34"
*/
@IsDate()
@ApiProperty()
updatedAt: Date;
}