Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbmx committed Sep 2, 2024
1 parent 1b27b56 commit 5af5c40
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public GsonConverterFactory(Gson gson) {
@Override
public <V> RequestBodyConverter<V> requestBodyConverter(final Class<V> type) {
TypeAdapter<V> adapter = gson.getAdapter(type);
return new GsonRequestBodyConverter<V>(adapter, MEDIA_TYPE);
return new GsonRequestBodyConverter<V>(gson, adapter, MEDIA_TYPE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package juno.http.convert.gson;

import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import juno.http.RequestBody;
import juno.http.convert.RequestBodyConverter;

public class GsonRequestBodyConverter<T> implements RequestBodyConverter<T> {

public final Gson gson;
public final TypeAdapter<T> adapter;
public final String contentType;

public GsonRequestBodyConverter(TypeAdapter<T> adapter, String contentType) {
public GsonRequestBodyConverter(Gson gson, TypeAdapter<T> adapter, String contentType) {
this.gson = gson;
this.adapter = adapter;
this.contentType = contentType;
}
Expand Down
Empty file.
Empty file.

0 comments on commit 5af5c40

Please sign in to comment.