When a new webhook type is added, it must be updated manually.
If we can prevent human errors, such as forgetting to update, that would be wonderful.
I believe this can be achieved in several ways, each being a realistic option:
- Write it with an OpenAPI generator
- However, since the OpenAPI generator is not well-suited for this, it might require significant workarounds.
- Scan the generated code (https://github.com/line/line-bot-sdk-ruby/tree/38d89d155ed80f4ad12401be72da790bf000ee53/lib/line/bot/v2/webhook/model), create a complete mapping, and then generate the parser.
- Scan the webhook.yaml and implement it.
- Like our line-bot-sdk-python, create a parse function within the class that uses polymorphism.
When a new webhook type is added, it must be updated manually.
If we can prevent human errors, such as forgetting to update, that would be wonderful.
I believe this can be achieved in several ways, each being a realistic option: