-
Notifications
You must be signed in to change notification settings - Fork 128
Fix request content in messaging test #457
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
Conversation
| request = { | ||
| "to" => "USER_ID", | ||
| "messages" => [{ type: 'text', text: ' Hello, world! ' }] | ||
| } |
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.
this (without using Line::Bot::V2::MessagingApi::PushMessageRequest) is acceptable as of now.
Q: I'm not sure if it's intentional. Is this intentional? @mokuzon
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.
It is not my intention to do so, but I do get a warning from RBS.
Since we do not strictly implement type checking, I think this is an unavoidable behavior.
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.
Thank you for the reply. Since it wasn't intentional, let's remove the current behavior from the spec (i.e., don't explicitly mention it in the documentation, but leave the code as is). On the other hand, I thought that v1 users might appreciate this behavior when migrating to v2, as it makes the migration process much simpler. There's no need to actively rewrite the request object.
If, in the future, this behavior becomes problematic for any SDK users, we can discontinue the current behavior.
The structure itself was completely wrong...
This change modifies tests to use both the hash and the SDK class, and also to verify the body using WebMock.