LINE Open APIが公開されました

# はじめに

[LINE OpenAPIをリリースしました](https://developers.line.biz/ja/news/2023/07/05/open-api/)とのことで。
LINEのMessaging APIをはじめとする各APIのOpen API仕様のレポジトリが公開されましたのでさらっと見てみます

[LINE Open API](https://github.com/line/line-openapi)

# Swagger UI で見てみる

レポジトリに公開されているYAMLを[Swagger UI](https://swagger.io/tools/swagger-ui/)のLive Demoで見てみます。ためしに以下のMessaging APIを入力してみます

https://raw.githubusercontent.com/line/line-openapi/main/messaging-api.yml

![スクリーンショット 2023-07-31 17.22.45.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/61995/09d429df-cbde-7ac4-f45d-8dd1e2478945.png)

[Send reply message](https://developers.line.biz/en/reference/messaging-api/#send-reply-message)リクエストボディやエラーレスポンスなどのデータがわかりやすいですね

![スクリーンショット 2023-07-31 17.24.49.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/61995/83249660-423b-8b6c-ea23-590659d19bbd.png)

# Open API Generatorでコードを生成してみる

[openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli)を利用してAPI仕様からコードを生成してみます。簡単のためにopenapi-generator-cliのdockerイメージを使います。Open API Generatorは非常に[多くの言語をサポート](https://openapi-generator.tech/docs/generators/#client-generators)していますが、今回は[typescript-fetch](https://openapi-generator.tech/docs/generators/typescript-fetch)を使ってみます

適当なパラメータでgenerateコマンドを叩くdocker-compose.ymlを作成します

```docker-compose.yml
version: "3.0"
services:
  openapi-generator-cli:
    image: openapitools/openapi-generator-cli
    volumes:
      - ./src:/dist
    command: generate -g typescript-fetch -i https://raw.githubusercontent.com/line/line-openapi/main/messaging-api.yml --additional-properties=modelPropertyNaming=camelCase,enumPropertyNaming=camelCase,enumUnknownDefaultCase=true,supportsES6=true,withInterfaces=true -o /dist
```

実行します

```shell
docker compose up
[+] Running 2/1
 ✔ Network line-openapi-generator-example_default                    Created0.0s 
 ✔ Container line-openapi-generator-example-openapi-generator-cli-1  Created0.1s 
Attaching to line-openapi-generator-example-openapi-generator-cli-1
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.DefaultGenerator - Generating with dryRun=false
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.c.ignore.CodegenIgnoreProcessor - No .openapi-generator-ignore file found.
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: typescript-fetch (client)
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.DefaultGenerator - Generator 'typescript-fetch' is considered stable.
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Hint: Environment variable 'TS_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write"' (Linux/Mac)
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Action.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AgeDemographic.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AgeDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AltUri.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AppTypeDemographic.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AppTypeDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AreaDemographic.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AreaDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AudienceMatchMessagesRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AudienceRecipient.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/AudioMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/BotInfoResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/BroadcastRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ButtonsTemplate.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/CameraAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/CameraRollAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/CarouselColumn.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/CarouselTemplate.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ChatReference.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ConfirmTemplate.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/CreateRichMenuAliasRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/DatetimePickerAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/DemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Emoji.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ErrorDetail.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ErrorResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Filter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBlockStyle.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBox.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBoxBackground.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBoxLinearGradient.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBubble.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexBubbleStyles.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexButton.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexCarousel.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexComponent.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexContainer.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexFiller.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexIcon.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexImage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexSeparator.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexSpan.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexText.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/FlexVideo.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GenderDemographic.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GenderDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GetAggregationUnitNameListResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GetAggregationUnitUsageResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GetFollowersResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GetMessageContentTranscodingResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GetWebhookEndpointResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GroupMemberCountResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GroupSummaryResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/GroupUserProfileResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImageCarouselColumn.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImageCarouselTemplate.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImageMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapArea.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapBaseSize.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapExternalLink.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ImagemapVideo.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/IssueLinkTokenResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Limit.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/LocationAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/LocationMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MarkMessagesAsReadRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MembersIdsResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Message.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MessageAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MessageImagemapAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MessageQuotaResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/MulticastRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/NarrowcastProgressResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/NarrowcastRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/NumberOfMessagesResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/OperatorDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/OperatorRecipient.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/PnpMessagesRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/PostbackAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/PushMessageRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/QuickReply.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/QuickReplyItem.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/QuotaConsumptionResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/QuotaType.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Recipient.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RedeliveryRecipient.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ReplyMessageRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuAliasListResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuAliasResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuArea.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchLinkOperation.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchOperation.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchProgressPhase.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchProgressResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchUnlinkAllOperation.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBatchUnlinkOperation.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBounds.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBulkLinkRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuBulkUnlinkRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuIdResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuListResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuSize.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RichMenuSwitchAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RoomMemberCountResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/RoomUserProfileResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Sender.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/SetWebhookEndpointRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/StickerMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/SubscriptionPeriodDemographic.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/SubscriptionPeriodDemographicFilter.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/Template.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/TemplateMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/TestWebhookEndpointRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/TestWebhookEndpointResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/TextMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/URIAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/URIImagemapAction.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/UpdateRichMenuAliasRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/UserProfileResponse.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/ValidateMessageRequest.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/VideoMessage.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] WARN  o.o.c.l.AbstractTypeScriptClientCodegen - Date (model name matches existing language type) cannot be used as a model name. Renamed to ModelDate
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/apis/MessagingApiApi.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/apis/MessagingApiBlobApi.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/index.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/runtime.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/apis/index.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/models/index.ts
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/.openapi-generator-ignore
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/.openapi-generator/VERSION
line-openapi-generator-example-openapi-generator-cli-1  | [main] INFO  o.o.codegen.TemplateManager - writing file /dist/.openapi-generator/FILES
line-openapi-generator-example-openapi-generator-cli-1  | ################################################################################
line-openapi-generator-example-openapi-generator-cli-1  | # Thanks for using OpenAPI Generator.                                          #
line-openapi-generator-example-openapi-generator-cli-1  | # Please consider donation to help us maintain this project 🙏                 #
line-openapi-generator-example-openapi-generator-cli-1  | # https://opencollective.com/openapi_generator/donate                          #
line-openapi-generator-example-openapi-generator-cli-1  | 
line-openapi-generator-example-openapi-generator-cli-1  | ################################################################################
line-openapi-generator-example-openapi-generator-cli-1  | 
line-openapi-generator-example-openapi-generator-cli-1 exited with code 0
```

コードが正常に生成されたようです

```shell
tree src
src
├── apis
│   ├── MessagingApiApi.ts
│   ├── MessagingApiBlobApi.ts
│   └── index.ts
├── index.ts
├── models
│   ├── Action.ts
│   ├── AgeDemographic.ts
│   ├── AgeDemographicFilter.ts
│   ├── AltUri.ts
│   ├── AppTypeDemographic.ts
│   ├── AppTypeDemographicFilter.ts
│   ├── AreaDemographic.ts
│   ├── AreaDemographicFilter.ts
│   ├── AudienceMatchMessagesRequest.ts
│   ├── AudienceRecipient.ts
│   ├── AudioMessage.ts
│   ├── BotInfoResponse.ts
│   ├── BroadcastRequest.ts
│   ├── ButtonsTemplate.ts
│   ├── CameraAction.ts
│   ├── CameraRollAction.ts
│   ├── CarouselColumn.ts
│   ├── CarouselTemplate.ts
│   ├── ChatReference.ts
│   ├── ConfirmTemplate.ts
│   ├── CreateRichMenuAliasRequest.ts
│   ├── DatetimePickerAction.ts
│   ├── DemographicFilter.ts
│   ├── Emoji.ts
│   ├── ErrorDetail.ts
│   ├── ErrorResponse.ts
│   ├── Filter.ts
│   ├── FlexBlockStyle.ts
│   ├── FlexBox.ts
│   ├── FlexBoxBackground.ts
│   ├── FlexBoxLinearGradient.ts
│   ├── FlexBubble.ts
│   ├── FlexBubbleStyles.ts
│   ├── FlexButton.ts
│   ├── FlexCarousel.ts
│   ├── FlexComponent.ts
│   ├── FlexContainer.ts
│   ├── FlexFiller.ts
│   ├── FlexIcon.ts
│   ├── FlexImage.ts
│   ├── FlexMessage.ts
│   ├── FlexSeparator.ts
│   ├── FlexSpan.ts
│   ├── FlexText.ts
│   ├── FlexVideo.ts
│   ├── GenderDemographic.ts
│   ├── GenderDemographicFilter.ts
│   ├── GetAggregationUnitNameListResponse.ts
│   ├── GetAggregationUnitUsageResponse.ts
│   ├── GetFollowersResponse.ts
│   ├── GetMessageContentTranscodingResponse.ts
│   ├── GetWebhookEndpointResponse.ts
│   ├── GroupMemberCountResponse.ts
│   ├── GroupSummaryResponse.ts
│   ├── GroupUserProfileResponse.ts
│   ├── ImageCarouselColumn.ts
│   ├── ImageCarouselTemplate.ts
│   ├── ImageMessage.ts
│   ├── ImagemapAction.ts
│   ├── ImagemapArea.ts
│   ├── ImagemapBaseSize.ts
│   ├── ImagemapExternalLink.ts
│   ├── ImagemapMessage.ts
│   ├── ImagemapVideo.ts
│   ├── IssueLinkTokenResponse.ts
│   ├── Limit.ts
│   ├── LocationAction.ts
│   ├── LocationMessage.ts
│   ├── MarkMessagesAsReadRequest.ts
│   ├── MembersIdsResponse.ts
│   ├── Message.ts
│   ├── MessageAction.ts
│   ├── MessageImagemapAction.ts
│   ├── MessageQuotaResponse.ts
│   ├── MulticastRequest.ts
│   ├── NarrowcastProgressResponse.ts
│   ├── NarrowcastRequest.ts
│   ├── NumberOfMessagesResponse.ts
│   ├── OperatorDemographicFilter.ts
│   ├── OperatorRecipient.ts
│   ├── PnpMessagesRequest.ts
│   ├── PostbackAction.ts
│   ├── PushMessageRequest.ts
│   ├── QuickReply.ts
│   ├── QuickReplyItem.ts
│   ├── QuotaConsumptionResponse.ts
│   ├── QuotaType.ts
│   ├── Recipient.ts
│   ├── RedeliveryRecipient.ts
│   ├── ReplyMessageRequest.ts
│   ├── RichMenuAliasListResponse.ts
│   ├── RichMenuAliasResponse.ts
│   ├── RichMenuArea.ts
│   ├── RichMenuBatchLinkOperation.ts
│   ├── RichMenuBatchOperation.ts
│   ├── RichMenuBatchProgressPhase.ts
│   ├── RichMenuBatchProgressResponse.ts
│   ├── RichMenuBatchRequest.ts
│   ├── RichMenuBatchUnlinkAllOperation.ts
│   ├── RichMenuBatchUnlinkOperation.ts
│   ├── RichMenuBounds.ts
│   ├── RichMenuBulkLinkRequest.ts
│   ├── RichMenuBulkUnlinkRequest.ts
│   ├── RichMenuIdResponse.ts
│   ├── RichMenuListResponse.ts
│   ├── RichMenuRequest.ts
│   ├── RichMenuResponse.ts
│   ├── RichMenuSize.ts
│   ├── RichMenuSwitchAction.ts
│   ├── RoomMemberCountResponse.ts
│   ├── RoomUserProfileResponse.ts
│   ├── Sender.ts
│   ├── SetWebhookEndpointRequest.ts
│   ├── StickerMessage.ts
│   ├── SubscriptionPeriodDemographic.ts
│   ├── SubscriptionPeriodDemographicFilter.ts
│   ├── Template.ts
│   ├── TemplateMessage.ts
│   ├── TestWebhookEndpointRequest.ts
│   ├── TestWebhookEndpointResponse.ts
│   ├── TextMessage.ts
│   ├── URIAction.ts
│   ├── URIImagemapAction.ts
│   ├── UpdateRichMenuAliasRequest.ts
│   ├── UserProfileResponse.ts
│   ├── ValidateMessageRequest.ts
│   ├── VideoMessage.ts
│   └── index.ts
└── runtime.ts

2 directories, 133 files
```

`src/models/ReplyMessageRequest.ts`を開いてみます

```ReplyMessageRequest.ts
/**
 * Check if a given object implements the ReplyMessageRequest interface.
 */
export function instanceOfReplyMessageRequest(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "replyToken" in value;
    isInstance = isInstance && "messages" in value;

    return isInstance;
}

export function ReplyMessageRequestFromJSON(json: any): ReplyMessageRequest {
    return ReplyMessageRequestFromJSONTyped(json, false);
}

export function ReplyMessageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReplyMessageRequest {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'replyToken': json['replyToken'],
        'messages': ((json['messages'] as Array<any>).map(MessageFromJSON)),
        'notificationDisabled': !exists(json, 'notificationDisabled') ? undefined : json['notificationDisabled'],
    };
}

export function ReplyMessageRequestToJSON(value?: ReplyMessageRequest | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'replyToken': value.replyToken,
        'messages': ((value.messages as Array<any>).map(MessageToJSON)),
        'notificationDisabled': value.notificationDisabled,
    };
}
```

それっぽい感じです。このリクエストデータを利用しているメソッドを`src/apis/MessagingApiApi.ts`から探してみます

```MessagingApiApi.ts
/**
     * Send reply message
     */
    async replyMessageRaw(requestParameters: ReplyMessageOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.replyMessageRequest === null || requestParameters.replyMessageRequest === undefined) {
            throw new runtime.RequiredError('replyMessageRequest','Required parameter requestParameters.replyMessageRequest was null or undefined when calling replyMessage.');
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/v2/bot/message/reply`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ReplyMessageRequestToJSON(requestParameters.replyMessageRequest),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }
```

実際に動かしてみてませんが、それっぽいですね。

# おわりに

Swagger UIの形式だとAPI仕様を調べるときわかりやすいですし、Open API Generatorを使えばクライアントの開発を効率化できる可能性もあります。活用すれば少なくともスキーマ定義のミスが減りそうなのでLINEアプリ開発の中で利用してみてはどうでしょうか。