Yousef
03/21/2022, 4:33 PMUnexpected JSON token at offset 11023: Expected start of the object '{', but had ':' instead
JSON input: .....","type":"BLOGPOST","category":"e054042e-bc50-4743-a6f5-94d9.....
and I'm not sure whyYousef
03/21/2022, 4:34 PM@Entity(tableName = POST_TABLE)
@Serializable
data class Content(
@PrimaryKey(autoGenerate = false) @SerialName("id") val postId: String,
val body: String,
@Transient var categoryId: String? = null,
val createdOn: LocalDateTime,
val hasBeenUpdated: Boolean,
val header: String,
val postLanguage: String,
val postSlug: String,
val postTitle: String,
val status: String,
val summary: String,
val type: String,
val updatedOn: LocalDateTime,
val visits: Int,
) {
@Ignore
val category: Category?=null
@Ignore
var subcategories: List<Subcategory>? = null
}
and category
@Entity(tableName = CATEGORY_TABLE)
@Serializable
data class Category(
@PrimaryKey(autoGenerate = false) @SerialName("id") val categoryId: String,
val categorySlug: String,
val categoryTitle: String
)
I'm not facing an issue with subcategories only the category classYousef
03/21/2022, 4:35 PM"createdOn": "2022-02-06T16:17:08.16067","updatedOn": "2022-02-06T16:17:08.16067",
"status": "PUBLISHED",
"type": "BLOGPOST",
"category": {
"id": "08e5788d-bc26-45a4-88fc-918ec5f7d8e9",
"categoryTitle": "Meta",
"categorySlug": "meta"
},
"subcategories": [],
ephemient
03/21/2022, 4:37 PM"category":"
, not "category": {
as in your exampleYousef
03/21/2022, 4:37 PMephemient
03/21/2022, 4:39 PMYousef
03/21/2022, 4:41 PMYousef
03/21/2022, 4:44 PMephemient
03/21/2022, 4:59 PMYousef
03/21/2022, 5:05 PMRichard Gomez
03/23/2022, 12:33 AMcategory
correctly because it's in the body and not defined in the constructor?