@JsonApi(type = "message")
MessageModel {...}
and
@JsonApi(type = "bodypart")
BodypartModel {...} are implementing interface Part:
interface Part {
var content: Body?
}
where content is overridden the following way:
@Ignore override var content: Body? = null
When I serialize the models, the field 'type' is generated twice. I could change the @JsonApi(type = "...") annotation to something else, so I see 2 'type' fields with two different values, it is generated from the JsonApi-Adapter and the Polymorpic Adapter, but I need both.
Maybe I am wrong and this can be solved in some way, but as far as I can see, the type-parameter in @JsonApi(type = "bodypart") should not be obligatory, as it is sometimes wrong to generate it.
I'm trying to generate JsonApi for an application in Kotlin and have the following adapters:
val jsonApiAdapterFactory: JsonAdapter.Factory = ResourceAdapterFactory.builder() .add(MessageModel::class.java) .add(MultipartModel::class.java) .add(BodypartModel::class.java) .add(SingleBodyModel::class.java) .build()
@JsonApi(type = "message") MessageModel {...} and @JsonApi(type = "bodypart") BodypartModel {...} are implementing interface Part:
interface Part { var content: Body? }
where content is overridden the following way: @Ignore override var content: Body? = null
When I serialize the models, the field 'type' is generated twice. I could change the @JsonApi(type = "...") annotation to something else, so I see 2 'type' fields with two different values, it is generated from the JsonApi-Adapter and the Polymorpic Adapter, but I need both.
Maybe I am wrong and this can be solved in some way, but as far as I can see, the type-parameter in @JsonApi(type = "bodypart") should not be obligatory, as it is sometimes wrong to generate it.