-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate clients from LINE OpenAPI #296
Conversation
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. |
def client | ||
@client ||= Line::Bot::Client.new do |config| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this pull request deletes examples/**
files? I think it would help line-bot-sdk-ruby beginners.
|
I guess, generated codes in 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:
|
Implemented KitchenSink example based on openapi
Add rich_menu example
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.