From e6e7cecdb65fc1db94815856bbd4278d33ae8fdf Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 24 Feb 2019 17:35:19 +0900 Subject: [PATCH] Refactor --- src/server/api/openapi/gen-spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/api/openapi/gen-spec.ts b/src/server/api/openapi/gen-spec.ts index db53a2859b..78569f1245 100644 --- a/src/server/api/openapi/gen-spec.ts +++ b/src/server/api/openapi/gen-spec.ts @@ -96,10 +96,10 @@ export function genOpenapiSpec(lang = 'ja-JP') { } if (endpoint.meta.params) { - for (const kv of Object.entries(endpoint.meta.params)) { - if (kv[1].desc) (kv[1].validator as any).desc = kv[1].desc[lang]; - if (kv[1].default) (kv[1].validator as any).default = kv[1].default; - porops[kv[0]] = kv[1].validator; + for (const [k, v] of Object.entries(endpoint.meta.params)) { + if (v.desc) (v.validator as any).desc = v.desc[lang]; + if (v.default) (v.validator as any).default = v.default; + porops[k] = v.validator; } }