pg-mvc-service 2.0.109 → 2.0.112

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.
@@ -400,47 +400,16 @@ class ResponseType extends ReqResType_1.default {
400
400
  const descIndentJoin = '\n ';
401
401
  if (list.length === 1) {
402
402
  // 単一エラーは1行説明
403
- ymlString += `
404
- '${status}':
405
- description: 【エラー】${list[0].description}
406
- content:
407
- application/json:
408
- schema:
409
- type: object
410
- properties:`;
403
+ ymlString += ` '${status}':
404
+ description: ${list[0].code}: ${list[0].description}
405
+ `;
411
406
  }
412
407
  else {
413
408
  // 複数エラーは箇条書き
414
409
  const bullets = list.map(e => `- ${e.code !== '' ? `${e.code}: ` : ''}${e.description}`).join(descIndentJoin);
415
- ymlString += `
416
- '${status}':
417
- description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
418
- content:
419
- application/json:
420
- schema:
421
- type: object
422
- properties:`;
423
- }
424
- if ([400, 404, 409, 422].includes(status)) {
425
- ymlString += `
426
- errorCode:
427
- type: string
428
- description: エラーコード
429
- errorMessage:
430
- type: string
431
- description: エラーメッセージ`;
432
- }
433
- else if (status === 401) {
434
- ymlString += `
435
- message:
436
- type: string
437
- description: Authentication expired. Please login again.`;
438
- }
439
- else if (status === 500) {
440
- ymlString += `
441
- message:
442
- type: string
443
- description: Internal Server Error`;
410
+ ymlString += ` '${status}':
411
+ description: |${descIndentJoin}${bullets}
412
+ `;
444
413
  }
445
414
  }
446
415
  return ymlString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "2.0.109",
3
+ "version": "2.0.112",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -445,46 +445,17 @@ export class ResponseType extends ReqResType {
445
445
 
446
446
  if (list.length === 1) {
447
447
  // 単一エラーは1行説明
448
- ymlString += `
449
- '${status}':
450
- description: 【エラー】${list[0].description}
451
- content:
452
- application/json:
453
- schema:
454
- type: object
455
- properties:`;
448
+ ymlString += ` '${status}':
449
+ description: ${list[0].code}: ${list[0].description}
450
+ `;
456
451
  } else {
457
452
  // 複数エラーは箇条書き
458
453
  const bullets = list.map(e => `- ${e.code !== '' ? `${e.code}: ` : ''}${e.description}`).join(descIndentJoin);
459
- ymlString += `
460
- '${status}':
461
- description: |${descIndentJoin}【エラー】${descIndentJoin}${bullets}
462
- content:
463
- application/json:
464
- schema:
465
- type: object
466
- properties:`;
454
+ ymlString += ` '${status}':
455
+ description: |${descIndentJoin}${bullets}
456
+ `;
467
457
  }
468
458
 
469
- if ([400, 404, 409, 422].includes(status)) {
470
- ymlString += `
471
- errorCode:
472
- type: string
473
- description: エラーコード
474
- errorMessage:
475
- type: string
476
- description: エラーメッセージ`;
477
- } else if (status === 401) {
478
- ymlString += `
479
- message:
480
- type: string
481
- description: Authentication expired. Please login again.`;
482
- } else if (status === 500) {
483
- ymlString += `
484
- message:
485
- type: string
486
- description: Internal Server Error`;
487
- }
488
459
  }
489
460
 
490
461
  return ymlString;