Skip to content

how do I send a null field to the server? #117

@KotlinWay

Description

@KotlinWay

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions