著者:しょっさん
ソフトウエアを正しく作るために、エンジニアたちはどんなことを知らなければならないでしょうか。実際のコードを使って、より良くしていくためのステップを考えてみましょう。第6回は、アプリケーションの開発やテストを実施する環境について詳しく考えます。
シェルスクリプトマガジン Vol.66は以下のリンク先でご購入できます。

図2 モックのコード(swagger.json)
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | {   "openapi" : "3.0.0",   "servers" : [ {     "description" : "Expense Reporter Sample API",     "url" : "https://virtserver.swaggerhub.com/sho7650/ExpenseMockServices/0.5.0"   } ],   "info" : {     "description" : "シェルスクリプトマガジン用サンプル",     "version" : "0.5.0",     "title" : "Expense API",     "contact" : {       "email" : "sho@oshiire.to"     },     "license" : {       "name" : "Apache 2.0",       "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"     }   },   "tags" : [ {     "name" : "users",     "description" : "一般利用者"   }, {     "name" : "approvers",     "description" : "承認者"   } ],   "paths" : { 		(略)     "/payment" : {       "get" : {         "tags" : [ "approvers" ],         "summary" : "支払い待ち一覧",         "operationId" : "findPayments",         "description" : "一般利用者からの請求一覧を表示",         "security" : [ {           "bearerAuth" : [ ]         } ], 		(略)         "responses" : {           "200" : {             "description" : "success",             "content" : {               "application/json" : {                 "schema" : {                   "type" : "array",                   "items" : {                     "$ref" : "#/components/schemas/ExpenseItem"                   }                 }               }             }           },           "400" : {             "description" : "bad input parameter"           }         }       }     }   },   "components" : {     "securitySchemes" : {       "bearerAuth" : {         "type" : "http",         "scheme" : "bearer",         "bearerFormat" : "JWT"       }     },     "schemas" : {       "id" : {         "type" : "integer",         "format" : "int32",         "example" : 120       }, 	(略)     }   } } |