Skip to content

Inconsistent data type of statusCode in API response #3755

@ms4sman

Description

@ms4sman

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.9.2

Description

In the API response for shortening a URL, if the request is successful, the statusCode in the JSON response is an integer. But in the case of an error, like the URL already having been shortened, the statusCode is returned as a string in the JSON.

Expectation

I would think it should be consistently one data type or the other.

Reproduction steps

Make a shorten API call for a new URL. The statusCode will be an integer in the response JSON. Now try to shorten the same URL again. In the error response the statusCode is now a string.

Context

I'd expect that both should be either an integer OR a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions