mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 17:55:17 -04:00
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:
parent
3f4f5936cb
commit
47ca8be78b
14 changed files with 95 additions and 7 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
import { IsDate, IsNumber, IsString } from 'class-validator';
|
||||
import { Revision } from './revision.entity';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class RevisionDto {
|
||||
/**
|
||||
|
@ -13,6 +14,7 @@ export class RevisionDto {
|
|||
* @example 13
|
||||
*/
|
||||
@IsNumber()
|
||||
@ApiProperty()
|
||||
id: Revision['id'];
|
||||
|
||||
/**
|
||||
|
@ -20,12 +22,14 @@ export class RevisionDto {
|
|||
* @example "# I am a heading"
|
||||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* Patch from the preceding revision to this one
|
||||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
patch: string;
|
||||
|
||||
/**
|
||||
|
@ -33,5 +37,6 @@ export class RevisionDto {
|
|||
* @example "2020-12-01 12:23:34"
|
||||
*/
|
||||
@IsDate()
|
||||
@ApiProperty()
|
||||
createdAt: Date;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue