retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

Request: update website to include example of how "User" class is declared

Open AndroidDeveloperLB opened this issue 4 years ago • 2 comments

  • [V ] Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.

As the title says, the "User" class is used on the website, but you can't see how it was declared:

https://square.github.io/retrofit/

For example, for this case:

@POST("users/new")
Call<User> createUser(@Body User user);

It could be as such, for example :

    class User(
        @SerializedName("first_name") val firstName: String?,
        @SerializedName("last_name") val lastName: String?)

AndroidDeveloperLB avatar Feb 22 '21 13:02 AndroidDeveloperLB

That example only works with Gson whereas we don't really specify what converter is being used.

JakeWharton avatar Aug 06 '21 19:08 JakeWharton

@JakeWharton It's an example. It could be nice to see some samples.

AndroidDeveloperLB avatar Aug 06 '21 19:08 AndroidDeveloperLB

In order to keep the website digestible I'm going to elect to leave this to the imagination.

JakeWharton avatar Mar 18 '24 13:03 JakeWharton

@JakeWharton Please reconsider. Learning from samples helps a lot.

AndroidDeveloperLB avatar Mar 18 '24 13:03 AndroidDeveloperLB