Explorar el Código

leave swagger jsdoc in error-apiv3.ts in app/src/server/modesl/vo/ and actuall ErrorV3 class is left in core/src/models/vo/error-apiv3.ts

Yohei-Shiina hace 3 años
padre
commit
ab83c611d5

+ 26 - 0
packages/app/src/models/vo/error-v3.ts

@@ -0,0 +1,26 @@
+// The jsdoc below is left here intentionally to be referenced by swagger's $ref in a file under src/server/routes/apiv3/**/*.js such as healthcheck.js
+// The actual ErrorV3 Class is moved to packages/core/models/vo/error-v3.js
+
+/**
+ * @swagger
+ *
+ *  components:
+ *    schemas:
+ *      ErrorV3:
+ *        description: Error for APIv3
+ *        type: object
+ *        properties:
+ *          message:
+ *            type: string
+ *            example: 'error message'
+ *          code:
+ *            type: string
+ *            example: 'someapi-error-with-something'
+ *          stack:
+ *            type: object
+ *          args:
+ *            type: object
+ *            example: { name: 'Josh', age: 20 }
+ */
+
+export {};

+ 0 - 22
packages/core/src/models/vo/error-apiv3.ts

@@ -1,25 +1,3 @@
-/**
- * @swagger
- *
- *  components:
- *    schemas:
- *      ErrorV3:
- *        description: Error for APIv3
- *        type: object
- *        properties:
- *          message:
- *            type: string
- *            example: 'error message'
- *          code:
- *            type: string
- *            example: 'someapi-error-with-something'
- *          stack:
- *            type: object
- *          args:
- *            type: object
- *            example: { name: 'Josh', age: 20 }
- */
-
 export class ErrorV3 extends Error {
 export class ErrorV3 extends Error {
 
 
   code: string;
   code: string;