mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 23:54:42 -04:00

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>
35 lines
846 B
TypeScript
35 lines
846 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
|
import { NoteAuthorshipDto } from './note-authorship.dto';
|
|
import { NoteMetadataDto } from './note-metadata.dto';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
export class NoteDto {
|
|
/**
|
|
* Markdown content of the note
|
|
* @example "# I am a heading"
|
|
*/
|
|
@IsString()
|
|
@ApiProperty()
|
|
content: string;
|
|
|
|
/**
|
|
* Metadata of the note
|
|
*/
|
|
@ValidateNested()
|
|
@ApiProperty({ type: NoteMetadataDto })
|
|
metadata: NoteMetadataDto;
|
|
|
|
/**
|
|
* Authorship information of this note
|
|
*/
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@ApiProperty({ isArray: true, type: NoteAuthorshipDto })
|
|
editedByAtPosition: NoteAuthorshipDto[];
|
|
}
|