sneako / finch

Elixir HTTP client, focused on performance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Finch.Request.t() typespec

visciang opened this issue · comments

While looking at the hexdoc to get the type of some request fields, I've seen that the Finch.Request.t() struct is not "typespec-ed", or better it's defined as:

@type t :: %Finch.Request{}

This results to:
https://hexdocs.pm/finch/Finch.Request.html#t:t/0

The @type could be defined as:

  @type t :: %__MODULE__{
          scheme: Mint.Types.scheme(),
          host: String.t(),
          port: :inet.port_number(),
          method: String.t(),
          path: String.t(),
          headers: headers(),
          body: body(),
          query: String.t(),
          unix_socket: nil | String.t()
        }

Is that intentional?
If not I can open a PR, just ping me here.

Thank you

Thanks @visciang ! I am not opposed to adding typespecs for all of the fields in the %Request{} struct. A PR is welcome!