I have problem parsing array of objects using Retrofit + RxJava
JSON contains only this array
{
"files": [
{
"id": 10,
"notificationId": 15,
"name": "cats.ncs",
"dateTime": "2019-01-07T17:34:45"
}
]
}
retrotfit service
@GET("/api/FileApi/files")
fun files(): Observable<FilesResponse>
where FilesResponse is
data class FilesResponse(
@SerializedName("files")
var files: List<FileElement>
)
and FileElement
data class FileElement(
@SerializedName("id")
var id: Long,
@SerializedName("notificationId")
var notificationId: Long,
@SerializedName("name")
var name: String,
@SerializedName("dateTime")
var dateTime: String
)
when I run it I get always
the return type of CallObjectMethodA does not match io.reactivex.Observable ApiService.files()
So how do I parse JSON containing only an array?