Skip to content

Commit f182a1b

Browse files
Merge pull request #17337 from Se3do/fix/doc-and-pipe-cleanup
Fix/doc and pipe cleanup
2 parents 3a6d07b + 15f30d3 commit f182a1b

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

packages/common/exceptions/misdirected.exception.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class MisdirectedException extends HttpException {
2222
*
2323
* By default, the JSON response body contains two properties:
2424
* - `statusCode`: this will be the value 421.
25-
* - `message`: the string `'Bad Gateway'` by default; override this by supplying
25+
* - `message`: the string `'Misdirected'` by default; override this by supplying
2626
* a string in the `objectOrError` parameter.
2727
*
2828
* If the parameter `objectOrError` is a string, the response body will contain an

packages/common/exceptions/not-acceptable.exception.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export class NotAcceptableException extends HttpException {
2222
*
2323
* By default, the JSON response body contains two properties:
2424
* - `statusCode`: this will be the value 406.
25-
* - `error`: the string `'Not Acceptable'` by default; override this by supplying
26-
* a string in the `error` parameter.
25+
* - `message`: the string `'Not Acceptable'` by default; override this by supplying
26+
* a string in the `objectOrError` parameter.
2727
*
2828
* If the parameter `objectOrError` is a string, the response body will contain an
2929
* additional property, `error`, with a short description of the HTTP error. To override the

packages/common/pipes/parse-array.pipe.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const DEFAULT_ARRAY_SEPARATOR = ',';
1616
/**
1717
* @publicApi
1818
*/
19-
export interface ParseArrayOptions extends Omit<
19+
export interface ParseArrayPipeOptions extends Omit<
2020
ValidationPipeOptions,
2121
'transform' | 'validateCustomDecorators' | 'exceptionFactory'
2222
> {
@@ -43,6 +43,9 @@ export interface ParseArrayOptions extends Omit<
4343
exceptionFactory?: (error: any) => any;
4444
}
4545

46+
/** @deprecated Use `ParseArrayPipeOptions` instead. */
47+
export type ParseArrayOptions = ParseArrayPipeOptions;
48+
4649
/**
4750
* Defines the built-in ParseArray Pipe
4851
*
@@ -55,7 +58,9 @@ export class ParseArrayPipe implements PipeTransform {
5558
protected readonly validationPipe: ValidationPipe;
5659
protected exceptionFactory: (error: string) => any;
5760

58-
constructor(@Optional() protected readonly options: ParseArrayOptions = {}) {
61+
constructor(
62+
@Optional() protected readonly options: ParseArrayPipeOptions = {},
63+
) {
5964
this.validationPipe = new ValidationPipe({
6065
transform: true,
6166
validateCustomDecorators: true,

packages/common/pipes/parse-date.pipe.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import {
77
} from '../utils/http-error-by-code.util';
88
import { isNil } from '../utils/shared.utils';
99

10+
/**
11+
* @publicApi
12+
*/
1013
export interface ParseDatePipeOptions {
1114
/**
1215
* If true, the pipe will return null or undefined if the value is not provided
@@ -30,6 +33,9 @@ export interface ParseDatePipeOptions {
3033
exceptionFactory?: (error: string) => any;
3134
}
3235

36+
/**
37+
* @publicApi
38+
*/
3339
@Injectable()
3440
export class ParseDatePipe implements PipeTransform<
3541
string | number | undefined | null

0 commit comments

Comments
 (0)