pg-mvc-service 2.0.107 → 2.0.109

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.
@@ -382,35 +382,6 @@ class ResponseType extends ReqResType_1.default {
382
382
  code: '',
383
383
  description: 'サーバー内部エラー(予期せぬエラー)'
384
384
  });
385
- // for (const error of errorList) {
386
- // ymlString += `
387
- // '${error.status}':
388
- // description: 【エラー】${error.description}
389
- // content:
390
- // application/json:
391
- // schema:
392
- // type: object
393
- // properties:`;
394
- // if ([400, 404, 409, 422].includes(error.status)) {
395
- // ymlString += `
396
- // errorCode:
397
- // type: string
398
- // description: エラーコード
399
- // errorMessage:
400
- // type: string
401
- // description: エラーメッセージ`;
402
- // } else if (error.status === 401) {
403
- // ymlString += `
404
- // message:
405
- // type: string
406
- // description: Authentication expired. Please login again.`;
407
- // } else if (error.status === 500) {
408
- // ymlString += `
409
- // message:
410
- // type: string
411
- // description: Internal Server Error`;
412
- // }
413
- // }
414
385
  // statusごとにグルーピング
415
386
  const grouped = {};
416
387
  for (const e of errorList) {
@@ -426,15 +397,15 @@ class ResponseType extends ReqResType_1.default {
426
397
  if (!list || list.length === 0) {
427
398
  continue;
428
399
  }
429
- const descIndentJoin = '\n ';
400
+ const descIndentJoin = '\n ';
430
401
  if (list.length === 1) {
431
402
  // 単一エラーは1行説明
432
403
  ymlString += `
433
404
  '${status}':
434
- description: 【エラー】${list[0].description}
435
- content:
405
+ description: 【エラー】${list[0].description}
406
+ content:
436
407
  application/json:
437
- schema:
408
+ schema:
438
409
  type: object
439
410
  properties:`;
440
411
  }
@@ -443,31 +414,31 @@ class ResponseType extends ReqResType_1.default {
443
414
  const bullets = list.map(e => `- ${e.code !== '' ? `${e.code}: ` : ''}${e.description}`).join(descIndentJoin);
444
415
  ymlString += `
445
416
  '${status}':
446
- description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
447
- content:
417
+ description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
418
+ content:
448
419
  application/json:
449
- schema:
420
+ schema:
450
421
  type: object
451
422
  properties:`;
452
423
  }
453
424
  if ([400, 404, 409, 422].includes(status)) {
454
425
  ymlString += `
455
- errorCode:
426
+ errorCode:
456
427
  type: string
457
428
  description: エラーコード
458
- errorMessage:
429
+ errorMessage:
459
430
  type: string
460
431
  description: エラーメッセージ`;
461
432
  }
462
433
  else if (status === 401) {
463
434
  ymlString += `
464
- message:
435
+ message:
465
436
  type: string
466
437
  description: Authentication expired. Please login again.`;
467
438
  }
468
439
  else if (status === 500) {
469
440
  ymlString += `
470
- message:
441
+ message:
471
442
  type: string
472
443
  description: Internal Server Error`;
473
444
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "2.0.107",
3
+ "version": "2.0.109",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -424,35 +424,6 @@ export class ResponseType extends ReqResType {
424
424
  code: '',
425
425
  description: 'サーバー内部エラー(予期せぬエラー)'
426
426
  })
427
- // for (const error of errorList) {
428
- // ymlString += `
429
- // '${error.status}':
430
- // description: 【エラー】${error.description}
431
- // content:
432
- // application/json:
433
- // schema:
434
- // type: object
435
- // properties:`;
436
- // if ([400, 404, 409, 422].includes(error.status)) {
437
- // ymlString += `
438
- // errorCode:
439
- // type: string
440
- // description: エラーコード
441
- // errorMessage:
442
- // type: string
443
- // description: エラーメッセージ`;
444
- // } else if (error.status === 401) {
445
- // ymlString += `
446
- // message:
447
- // type: string
448
- // description: Authentication expired. Please login again.`;
449
- // } else if (error.status === 500) {
450
- // ymlString += `
451
- // message:
452
- // type: string
453
- // description: Internal Server Error`;
454
- // }
455
- // }
456
427
 
457
428
  // statusごとにグルーピング
458
429
  const grouped: { [status: number]: IError[] } = {};
@@ -470,16 +441,16 @@ export class ResponseType extends ReqResType {
470
441
  const list = grouped[status];
471
442
  if (!list || list.length === 0) { continue; }
472
443
 
473
- const descIndentJoin = '\n ';
444
+ const descIndentJoin = '\n ';
474
445
 
475
446
  if (list.length === 1) {
476
447
  // 単一エラーは1行説明
477
448
  ymlString += `
478
449
  '${status}':
479
- description: 【エラー】${list[0].description}
480
- content:
450
+ description: 【エラー】${list[0].description}
451
+ content:
481
452
  application/json:
482
- schema:
453
+ schema:
483
454
  type: object
484
455
  properties:`;
485
456
  } else {
@@ -487,30 +458,30 @@ export class ResponseType extends ReqResType {
487
458
  const bullets = list.map(e => `- ${e.code !== '' ? `${e.code}: ` : ''}${e.description}`).join(descIndentJoin);
488
459
  ymlString += `
489
460
  '${status}':
490
- description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
491
- content:
461
+ description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
462
+ content:
492
463
  application/json:
493
- schema:
464
+ schema:
494
465
  type: object
495
466
  properties:`;
496
467
  }
497
468
 
498
469
  if ([400, 404, 409, 422].includes(status)) {
499
470
  ymlString += `
500
- errorCode:
471
+ errorCode:
501
472
  type: string
502
473
  description: エラーコード
503
- errorMessage:
474
+ errorMessage:
504
475
  type: string
505
476
  description: エラーメッセージ`;
506
477
  } else if (status === 401) {
507
478
  ymlString += `
508
- message:
479
+ message:
509
480
  type: string
510
481
  description: Authentication expired. Please login again.`;
511
482
  } else if (status === 500) {
512
483
  ymlString += `
513
- message:
484
+ message:
514
485
  type: string
515
486
  description: Internal Server Error`;
516
487
  }