Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
55 views

I'm trying to parse the response from OpenAI transcription API with streaming enabled. The request is: curl https://api.openai.com/v1/audio/transcriptions \ -H "Authorization: Bearer $...
dr.apk's user avatar
  • 11
0 votes
0 answers
53 views

It seems perfectly possible for an annotation processor to generate json adapters for interfaces or abstract classes, at least in kotlin. Why doesn't moshi do this? There must be some use case that I ...
Roger's user avatar
  • 583
1 vote
1 answer
256 views

I fail to get serialization to work inside a small springboot application. Read a couple of issues, guides and documentation on this. But still fail to get this to work. I use moshi for JSON ...
arkascha's user avatar
  • 43.2k
0 votes
0 answers
124 views

I'm currently facing a build failure in my Android project that uses Kotlin DSL with a version.toml file for dependency management. During the build process, I encounter multiple failures related to ...
Fátima Ramone's user avatar
1 vote
0 answers
97 views

I'm using Retrofit with OkHttp and Moshi. I have to add the "Accept-Encoding":"gzip, deflate, br" header myself. But OkHttp adds its own "Accept-Encoding" header. Due to ...
Mustafa Tatarhan's user avatar
1 vote
1 answer
687 views

I'm using moshi which accesses the Kotlin default constructor of a class by reflection. The class looks like this: @JsonClass(generateAdapter = true) data class AClassName( val threadId: String, ...
der_Fidelis's user avatar
  • 1,515
0 votes
1 answer
115 views

In Android, I am using an extension function to map a failed network response to my sealed ErrorResponse class. @JsonClass(generateAdapter = true) data class ErrorResponse( @Json(name = "code&...
tzegian's user avatar
  • 609
1 vote
1 answer
831 views

Hi everyone I have the following code that I use to serialize into json strings to store in shared preferences interface Serializer { public fun <T> serialize(data: T, type: Class<T>): ...
Abdelrhman Talat's user avatar
1 vote
1 answer
137 views

I have the below json response {"page":2, "results":{ "0":{ "id":1, "name":"Jane" }, "1":{ "...
Raji A C's user avatar
  • 2,391
1 vote
0 answers
50 views

I'm encountering an issue with GetStream.io while querying users. Despite explicitly setting the "invisible" field to false in the user object during the query, the field remains null in the ...
Xynapz1 Test's user avatar
1 vote
0 answers
140 views

I'm using an API that returns the following data: { "ad": "Andorra", "ae": "United Arab Emirates", "af": "Afghanistan", &...
Daniel Bertoldi's user avatar
0 votes
1 answer
279 views

The sample source JSON object is defined as: { "source": "WIFI" } However, the value can be lowercase and when it does, I get following error. Exception in thread "main&...
Hossain Khan's user avatar
  • 6,452
0 votes
2 answers
611 views

I am using Moshi as Json Converter with Retrofit in Android. When I set minifyEnabled to true, For some API calls it works, but for others it throws this Error: This callable does not support a ...
Omar Assidi's user avatar
3 votes
0 answers
142 views

Recent version of Moshi (1.15.0) is issuing a warning Kapt support in Moshi Kotlin Code Gen is deprecated and will be removed in 2.0. Please migrate to KSP. https://github.com/square/moshi#codegen&...
mar3kk's user avatar
  • 1,956
1 vote
0 answers
182 views

Given a simple data class import com.squareup.moshi.Json import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class User( @field:Json(name = "name") val name: ...
Cheok Yan Cheng's user avatar
1 vote
1 answer
455 views

I have a JSON object (that I can't change) that passes some data like so: { "title": "foo", "actions": "[ { \"label\": \"Hello\" ...
der_Fidelis's user avatar
  • 1,515
0 votes
1 answer
1k views

There is a Json file which is put to val fileInString: String. This string looks simplistically like this. { "groups": 2, "group1": [ { "word": "test11", "...
Tropic's user avatar
  • 3
0 votes
2 answers
861 views

I'm trying to use @Json(name = "Result") property to change the field name and it's not working. The result is always null from retrofit response, but if I use the actual "Result" ...
IAmNotARobot's user avatar
  • 1,482
1 vote
2 answers
449 views

With all the posts out there about Moshi and people's confusion (including my own) about how to parse a list, I can't believe that this is this difficult. I have an object that has two nested lists. I ...
AndroidDev's user avatar
  • 21.4k
0 votes
0 answers
104 views

when I post an api, it took too many time to response Here is my retrofit builder: fun provideRetrofit(baseUrl: String): Retrofit = Retrofit.Builder() .client(provideOkhttpClient()) ....
aile's user avatar
  • 1
1 vote
0 answers
156 views

I have an interface Data with a function called toData(). Different objects inherits from this Data. Now I wrote an adapter which transform the result of toData() into an string My custom adapter ...
kuzdu's user avatar
  • 7,584
0 votes
1 answer
119 views

I want to parse the following JSON API response into the list of objects. As you can see, the field "record" is polymorphic. [ { "t_id": "638975A6-3E5A-4D38-82A0-...
gdrt's user avatar
  • 3,345
-1 votes
1 answer
128 views

Hi I'm currently working on a android app (android studio) for a class and i need to make API calls i followed some tutorials (android developper and some on YT). From these tutorial i learned to use ...
Zares's user avatar
  • 1
1 vote
0 answers
166 views

I am trying to enable code obfuscation in my android project. I am using moshi for json operations. I am having a problem with release apk file. When I use a decompiler the @JsonClass(generateAdapter =...
Omer KAPLANDROID's user avatar
1 vote
1 answer
75 views

I am trying to make an API call to open-meteo.com API each time I run my app I get the an error: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT I have checked several ...
robson idongesit samuel's user avatar
1 vote
1 answer
3k views

My build.gradle dependencies (for a non-main Android Studio module): dependencies { implementation 'androidx.core:core-ktx:1.12.0' implementation 'com.squareup.moshi:moshi-kotlin:1.14.0' ...
LyrePyre's user avatar
  • 563
0 votes
1 answer
293 views

An error occurs during runtime, after updating to gradle 8.1.1 from 7.4.2: "java.lang.IllegalArgumentException: Unable to create converter for class $myEnumClass Caused by: java.lang....
Nikos M's user avatar
  • 194
0 votes
1 answer
819 views

I am trying to enable R8 for my project : https://github.com/alirezaeiii/TMDb-Compose-Playground buildTypes { release { minifyEnabled true shrinkResources true ...
Ali's user avatar
  • 10k
0 votes
1 answer
50 views

I use an AWS DynamoDB database to store data. I'm saving a "CommunityUser" object, which class looks as follows: class CommunityUser { @get:DynamoDBHashKey(attributeName = AWSTables....
Diego Perez's user avatar
  • 3,034
1 vote
1 answer
476 views

I'm migrating Gson to Moshi, and I'm having problems serializing List<object>. I have no problem with "plain" objects, but with Lists. I have a class ImageDTO (including a Moshi ...
Diego Perez's user avatar
  • 3,034
0 votes
1 answer
2k views

I have a json than can have two possible values {"school.name": "A school name"} or {"name": "Another school name"} And I have a common "College" ...
Diego Perez's user avatar
  • 3,034
1 vote
1 answer
779 views

I have a polymorphic list of contents sent by the backend. I use PolymorphicJsonAdapterFactory to parse it to Kotlin objects. It all works fine. When the backend sends an element with an unknown type ...
Camilo Sierra Rodriguez's user avatar
2 votes
1 answer
1k views

When proguard is enabled, after an API call with retrofit, I recieve a list of LinkedHashMapTree that causes this error: java.lang.ClassCastException: com.squareup.moshi.LinkedHashTreeMap cannot be ...
TabascoLosco's user avatar
0 votes
0 answers
61 views

Note: This is done in Kotlin in Android studio. Here is the documentation of my API: https://www.api-football.com/documentation-v3#tag/Teams/operation/get-teams I am trying to make a simple call to ...
Dereck Helms's user avatar
0 votes
1 answer
392 views

I want to call a login api that I've been using for over 6 years, so I know the API is good. It is already in production, and used for our website, iOS app, and Android app. My current project is ...
jonathan3087's user avatar
0 votes
2 answers
724 views

For a JSON like this consider the properties other than attributes are dynamic: "records": [ { "attributes": { "type": "...", "url": ...
Gopal S Akshintala's user avatar
1 vote
2 answers
211 views

Getting error while parsing the API response using Moshi. Sample Reponses: Expected API response {"itemsValues":[{"Id":"567"},{"Id":"678"}]} If list ...
Android Dev's user avatar
-1 votes
1 answer
694 views

Iam unable to convert this Json, keep getting the following error: com.squareup.moshi.JsonDataException: Expected a string but was BEGIN_OBJECT at path {"summary": { "rows": [ ...
Eknath's user avatar
  • 174
1 vote
0 answers
460 views

I have this API Response { "id": 45, "name": "Bill", "status": "Alive", } the status prop can have three possible results: Alive, Dead and ...
Eduardo Martins's user avatar
15 votes
6 answers
11k views

I recently upgraded to Android Studio Flamingo and AGP 8.0 My production builds with minfiy and shrinkResources enabled, doesn't allow retrofit to make calls. This is the error thrown. java.lang....
Abhishek AN's user avatar
0 votes
1 answer
2k views

I hava a value classin my android project (kotlin) and I want to parse a object, that contains this value class as type for a attribute, to json. Let's say this is my value class: @JsonClass(...
Thomas Cirksena's user avatar
0 votes
2 answers
1k views

I'm new to Moshi and I was thinking to implement it to replace my Gson lib. Can't figure out how exactly I can convert a model class into a string in JSON format. My model is UiGeneralCategory I have ...
Vlad.mir's user avatar
  • 705
0 votes
1 answer
653 views

My use case is that in data classes wherever I have used Boolean as type, in JSON that can either comes as double quote string ("true") or normal boolean (true) Earlier I was using Gson &...
Ujjwal Kumar Maharana's user avatar
-1 votes
1 answer
2k views

I am new to Retrofit and I am having a weird problem. I am getting the following error --> Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ However when I hit the endpoint with ...
user1743524's user avatar
2 votes
0 answers
47 views

I do have a json: { "items":[ { "id":"0000301553526", "values":{ "name":{ "value":{ ...
Unii's user avatar
  • 1,617
1 vote
1 answer
539 views

We are using old backend. Sometimes list of objects is returned when contract says it should be text (and other ways). How/where can we handle JsonDataException Expected a string but was BEGIN_OBJECT ...
Unii's user avatar
  • 1,617
0 votes
0 answers
81 views

I'm new with Moshi and I'm trying to parse the data, with Retrofit, from one class that extends an Arraylist of items and I'm getting this error: com.squareup.moshi.JsonDataException: Expected ...
S.P.'s user avatar
  • 2,604
2 votes
1 answer
1k views

In my app, I'm using Retrofit to get the data from API (with flights data). I want to obatin List< Itinerary > from JSON, but the problem is that it is badly formatted, and I'm getting the ...
deja's user avatar
  • 536
1 vote
0 answers
816 views

I try to do post request using retrofit and I use moshi to serialize but I'm not very well versed in these matters. And I am facing such an error, what is the reason for this? error E/AndroidRuntime: ...
NewPartizal's user avatar
  • 1,298
0 votes
1 answer
290 views

I call network operations like this. viewModelScope.launch { try { val data = withContext(dispatcher.io()) { homeRepository.getData() } } catch (e: Throwable) { val error = ...
Frank Mung No's user avatar

1
2 3 4 5
11