All Questions
10 questions
0
votes
1
answer
1k
views
IllegalArgumentException Moshi thinks I'm using ArrayList(java) when I'm using List(Kotlin)
I'm new to Kotlin and I still don't fully get the syntax for some stuff, expecially inside a lambda. I'm trying to build a simple REST api for uni project, currently messing with ktor, exposed and ...
1
vote
0
answers
696
views
Required value 'firstName' (JSON name 'first_name') missing at $ with retrofit moshi
Retrofit Moshi failed to create @Body,
if I change from @put to @post error is gone, don't know the reason, any clue?
data class UserProfileDto(
@JSON(name = "first_name") val firstName: ...
1
vote
2
answers
4k
views
How to skip JSON properties in Moshi?
I'm trying to implement JSON parsing in my Android application written in Kotlin using com.squareup.moshi (v1.10.0).
Within the JSON file there are some properties that are not interesting in my case. ...
1
vote
1
answer
3k
views
How to convert list of int in json to list/array of enums using Moshi?
I'm getting a list of ints (which are really enums) from the API. When I try to parse it, I get: Unable to create converter for java.util.List<MyEnum>
My adapter is currently looking like this:
@...
3
votes
1
answer
2k
views
Missing label with PolymorphicJsonAdapterFactory
I'm trying to use PolymorphicJsonAdapterFactory in order to obtain different types, but am always getting odd exception:
Missing label for test_type
My entity:
@JsonClass(generateAdapter = true)
...
5
votes
2
answers
3k
views
Moshi parsing with InputStream
Assuming I need to parse a huge list of Items from a json asset file in Android with the format similar to below:
[
{
"id": 1,
"name: "Tom"
// other stuff to describe "...
1
vote
1
answer
2k
views
Moshi: multiple JSON properties into one field of a class
Let's say we have this JSON structures:
"data": [
{
"order_id": 460,
"order_no": "365"
},
....
]
"data": {
"id": 460,
"order_no": "365"...
0
votes
0
answers
161
views
Moshi For parsing Youtube Search Api
I have been trying to find a tutorial for Moshi library in android java for parsing some complicated api but am unable to do so....
any help is appriciated ...
Api sample Value
{
"kind": "youtube#...
1
vote
1
answer
1k
views
Nested Array Parsing for converting to a Json through Moshi
I have a JSON string of this format
{
"user": "sam",
"password": "abcd1234",
"categories":
[
{
"fruit name": "watermelon"
},
{
"fruit name":"jackfruit"
...
10
votes
1
answer
4k
views
Moshi - Parse unknown json keys
How can I parse with moshi a json structure that has keys that are unknown at compile time:
"foo": {
"name": "hello",
"bar": {
"unknownKey1": {
"a": "1"
}
},
"unknownKey2":...