problem-details
Version:
HTTP problem details model based on RFC7807
25 lines (19 loc) • 552 B
text/typescript
import { HttpStatus } from './http-status';
import { IsString, Min, Max, IsUrl, IsAlphanumeric } from 'class-validator';
export class ProblemDefinition {
()
type: string;
()
title: string;
(100) // minimum HTTP status code
(599) // maximum HTTP status code
status: HttpStatus | number;
()
code: string;
constructor(type: string, title: string, status: HttpStatus | number, code: string) {
this.type = type;
this.title = title;
this.status = status;
this.code = code;
}
}