Skip to content

Definition of 'parsed_response' method in httparty.rbs is wrong. #466

@andredriem

Description

@andredriem

In the file httparty.rbs, the method parsed_response is inaccurately documented to return a string. However, upon examining the source code, it's clear that the parsed_response method's return type is determined by the Content-Type header of the HTTP response. The potential return types include:

  • nil (if the HTTP response has no body),
  • String,
  • Array[Array[untyped]], or
  • Hash.

It's important to note that users have the ability to override the parser, as illustrated in the code documentation. This flexibility allows for a variety of user-defined return types, making this a potentially common scenario. Given this recommended usage of the API, it would be wise to change the return type of 'parsed_response' to 'Object'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions