@origins-digital/zod-openapi-utils 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BadRequestException } from '@nestjs/common';
|
|
2
|
+
import { ZodError } from 'zod';
|
|
3
|
+
export declare class ZodValidationException extends BadRequestException {
|
|
4
|
+
private error;
|
|
5
|
+
constructor(error: ZodError);
|
|
6
|
+
getZodError(): ZodError<any>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=zod.exception.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.exception.d.ts","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAc,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B,qBAAa,sBAAuB,SAAQ,mBAAmB;IACjD,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAQ5B,WAAW;CAGnB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZodValidationException = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
class ZodValidationException extends common_1.BadRequestException {
|
|
6
|
+
constructor(error) {
|
|
7
|
+
super({
|
|
8
|
+
statusCode: common_1.HttpStatus.BAD_REQUEST,
|
|
9
|
+
message: 'Validation failed',
|
|
10
|
+
errors: error.errors,
|
|
11
|
+
});
|
|
12
|
+
this.error = error;
|
|
13
|
+
}
|
|
14
|
+
getZodError() {
|
|
15
|
+
return this.error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ZodValidationException = ZodValidationException;
|
|
19
|
+
//# sourceMappingURL=zod.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.exception.js","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":";;;AAAA,2CAAiE;AAGjE,MAAa,sBAAuB,SAAQ,4BAAmB;IAC7D,YAAoB,KAAe;QACjC,KAAK,CAAC;YACJ,UAAU,EAAE,mBAAU,CAAC,WAAW;YAClC,OAAO,EAAE,mBAAmB;YAC5B,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QALe,UAAK,GAAL,KAAK,CAAU;IAMnC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAZD,wDAYC"}
|