Skip to content

Commit

Permalink
Fix typespecs for some functions (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinBoers authored Jul 28, 2023
1 parent 0c70be2 commit e86effa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ defmodule Req do
@doc """
Makes a GET request.
`request` can be one of:
* a `String` or `URI`;
* a `Keyword` options;
* a `Req.Request` struct
See `new/1` for a list of available options.
## Examples
Expand All @@ -407,7 +413,7 @@ defmodule Req do
200
"""
@spec get(url() | Req.Request.t(), options :: keyword()) ::
@spec get(url() | keyword() | Req.Request.t(), options :: keyword()) ::
{:ok, Req.Response.t()} | {:error, Exception.t()}
def get(request, options \\ [])

Expand Down Expand Up @@ -591,7 +597,7 @@ defmodule Req do
iex> resp.body["data"]
"hello!"
"""
@spec post(url() | Req.Request.t(), options :: keyword()) ::
@spec post(url() | keyword() | Req.Request.t(), options :: keyword()) ::
{:ok, Req.Response.t()} | {:error, Exception.t()}
def post(request, options \\ [])

Expand Down Expand Up @@ -676,7 +682,7 @@ defmodule Req do
iex> resp.body["data"]
"hello!"
"""
@spec put(url() | Req.Request.t(), options :: keyword()) ::
@spec put(url() | keyword() | Req.Request.t(), options :: keyword()) ::
{:ok, Req.Response.t()} | {:error, Exception.t()}
def put(request, options \\ [])

Expand Down Expand Up @@ -761,7 +767,7 @@ defmodule Req do
iex> resp.body["data"]
"hello!"
"""
@spec patch(url() | Req.Request.t(), options :: keyword()) ::
@spec patch(url() | keyword() | Req.Request.t(), options :: keyword()) ::
{:ok, Req.Response.t()} | {:error, Exception.t()}
def patch(url_or_request, options \\ [])

Expand Down

0 comments on commit e86effa

Please sign in to comment.