kamikat / moshi-jsonapi

JSON API v1.0 Specification in Moshi.
MIT License
156 stars 35 forks source link

Nulls values #116

Closed KotlinWay closed 2 years ago

KotlinWay commented 2 years ago

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":"note","id":"168356"}} How can I send null?