Closed zenizh closed 6 months ago
To maintain compatibility with previous versions, I have made the following commit. This allows methods from previous versions to be used without modification, while still displaying the warning message. https://github.com/line/line-bot-sdk-ruby/pull/296/commits/c8b141cc781cdb0679f51ccf10c54892ef57174c
validate_signature
method should be implemented in the latest version.
I guess, generated codes in lib/clients/webhook
doesn't support deserializing webhook's payload.
req = LINE::Client::Webhook::CalbackRequest.new(JSON.parse(request_body))
won't parse Hash object to nested object.
I mean, req
is instance of LINE::Client::Webhook::CalbackRequest
. But req.events[0]
is just Hash, not an instance of the LINE::Client::Webhook::Event
.
It's suprising.
I added the following code:
is bit strange.
This endpoint has two functionalities: 'Issue from channel ID and channel secret' and 'Issue from JWT assertion.'
For 'Issue from channel ID and channel secret,' you need to make the request with 'grant_type,' 'client_id,' and 'client_secret.'
For 'Issue from JWT assertion,' you need to make the request with 'grant_type,' 'client_assertion_type,' and 'client_assertion.'
The OpenAPI definition specifies that one of these requests is required: link to the OpenAPI definition.
However, in this PR, all the required parameters for both patterns are listed, and there are a few issues:
This pull request will be submitted as a new pull request, so it is closed for now.
I generated clients according to the definition of LINE OpenAPI using OpenAPI Generator. I also set up the workflow for GitHub Actions and other related tasks.
Policy of change
This PR uses the OpenAPI Generator to build clients. The OpenAPI Generator generates clients as gems, which means it generates as many gems as there are clients.
On the other hand, we want a single gem, line-bot-api. So we ignore the auto-generated files that we need as a gem with
.gitignore
.This makes it work as a single gem by reading each client entry point from
lib/line/client.rb
.I will also add a script called
bin/generate-clients
. This helps to generate clients in the local environment and is also used to generate clients on GitHub Actions.Change details
The main files changed in this PR are:
How to review
Due to the large number of files in the difference, it is easier to review the PR source branch: https://github.com/zenizh/line-bot-sdk-ruby/tree/openapi
This pull request resolves #292, resolves #283, resolves #282, resolves #255, resolves #252, resolves #251, resolves #244, resolves #232, resolves #191.