Skip to content

[9.2.0] Strings of integers are incorrectly parsed as integers #420

@diareuse

Description

@diareuse

Repro

api.createPlaylist(userId, "2025")
    .description("2025")
    .build()
    .execute()

Acceptance criteria

IF the playlist doesn't exist THEN creates a brand new playlist with the given name ELSE fails with API error.

Actual

Playlist fails to create as the argument of name and description are parsed as integers in the request body which in turn is not parseable by the Spotify API prevalidator and fails the request.


Notes

Custom Gson wrapper does not take in account the input types which can under some circumstances fail to serialize the body. I'd argue that parsing integer from string in this context is rarely needed and if it's need it should require the input type to be an integer as not to guess the actual type (which it does obviously wrong).

Tested versions

Previously Used: 8.4.1
Currently Used: 9.2.0

Metadata

Metadata

Assignees

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