Skip to content
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

Update @param of methods on Connection #1452

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

yykamei
Copy link
Contributor

@yykamei yykamei commented Oct 1, 2022

Description

Methods on Connection with the name of HTTP verb, such as post, depend on run_request, and it receives the following parameters:

  • url as String, URI, or nil (if it's omitted or explicitly set)
  • body as String or nil (if it's omitted or explicitly set)
  • headers as Hash or nil (if it's omitted or explicitly set)

I think the current YARD doc could be updated to follow the implemented behavior. Especially, the URI type looks to be worth being described because the type is supported by `Request#url.

Besides, I updated the body of run_request as well as Request#body because the body will be passed to Faraday::Env#new through Request#to_env, and Faraday::Env#body seems String.

Todos

  • [ ] Tests (This PR just updated the YARD doc)
  • Documentation

Additional Notes

Perhaps, other YARD comments could be updated, but I focused on run_request and its related methods.

Methods on `Connection` with the name of HTTP verb, such as `post`,
depend on `run_request`, and it receives the following parameters:

* `url` as `String`, `URI`, or `nil` (if it's omitted or explicitly set)
* `body` as `String` or `nil` (if it's omitted  or explicitly set)
* `headers` as `Hash` or `nil` (if it's omitted  or explicitly set)

I think the current YARD doc could be updated to follow the implemented
behavior. Especially, the `URI` type looks to be worth being described
because the type is supported by `Request#url`.

Besides, I updated the `body` of `run_request` as well as `Request#body`
because the `body` will be passed to `Faraday::Env#new` through
`Request#to_env`, and `Faraday::Env#body` seems `String`.
Copy link
Member

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for spotting this and fixing the YARD documentation 🙏!

@iMacTia iMacTia merged commit fe6e71b into lostisland:main Oct 3, 2022
@yykamei yykamei deleted the add-URI-nil-on-run_request branch October 3, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants