You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I put null in the network model field?
I have a model like this
@jsonapi(type = "notes")
data class Note(
var name: String? = null,
var description: String? = null,
var note: String? = null, @field:Json(name = "created-at")
var createdAt: Date? = null
}
I want to patch the null value in the createdAt field to the server, but this field is ignored and it simply does not exist in the body.
{"data":{"type":"notes","id":"168356"}}
How can I send null?
The text was updated successfully, but these errors were encountered:
@kamikat, .serializeNulls() method is useless in this case because of skipping null fields in ResourceAdapter.writeFields. Of course this skip can be avoided by setting writer.setSerializeNulls(true), but in this case all the null fields of this object will be written into JSON. Which is not the goal, because we want to write only one specific field as null. It will be good to have something like @SerializeNulls annotation for the field.
How do I put null in the network model field?
I have a model like this
@jsonapi(type = "notes")
data class Note(
var name: String? = null,
var description: String? = null,
var note: String? = null,
@field:Json(name = "created-at")
var createdAt: Date? = null
}
I want to patch the null value in the createdAt field to the server, but this field is ignored and it simply does not exist in the body.
{"data":{"type":"notes","id":"168356"}}
How can I send null?
The text was updated successfully, but these errors were encountered: