mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-06 01:21:39 -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
254501d3e5
commit
3620416ed6
14 changed files with 95 additions and 7 deletions
|
@ -5,11 +5,13 @@
|
|||
*/
|
||||
|
||||
import { IsBoolean } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class HistoryEntryUpdateDto {
|
||||
/**
|
||||
* True if the note should be pinned
|
||||
*/
|
||||
@IsBoolean()
|
||||
@ApiProperty()
|
||||
pinStatus: boolean;
|
||||
}
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
*/
|
||||
|
||||
import { IsArray, IsBoolean, IsDate, IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class HistoryEntryDto {
|
||||
/**
|
||||
* ID or Alias of the note
|
||||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
identifier: string;
|
||||
|
||||
/**
|
||||
|
@ -19,6 +21,7 @@ export class HistoryEntryDto {
|
|||
* @example "Shopping List"
|
||||
*/
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
title: string;
|
||||
|
||||
/**
|
||||
|
@ -26,10 +29,12 @@ export class HistoryEntryDto {
|
|||
* @example "2020-12-01 12:23:34"
|
||||
*/
|
||||
@IsDate()
|
||||
@ApiProperty()
|
||||
lastVisited: Date;
|
||||
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
@ApiProperty()
|
||||
tags: string[];
|
||||
|
||||
/**
|
||||
|
@ -37,5 +42,6 @@ export class HistoryEntryDto {
|
|||
* @example false
|
||||
*/
|
||||
@IsBoolean()
|
||||
@ApiProperty()
|
||||
pinStatus: boolean;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue