Skip to content

[Technical Question] sendReportedProperties where property value has custom Jackson annotations #917

@jokarl

Description

@jokarl

In our project we rely heavily on Jackson annotations and custom deserializers. When I want to report one of our objects using sendReportedProperties, things get a bit iffy:

deviceClient.sendReportedProperties(Set.of(new Property("config", OurJacksonAnnotatedClass.builder().withPosition(Position.from(0,0)).build())));

This updates the twin but serializes a lot of internals of the class that we don't want. I could serialize the object myself using Jackson, but that will instead generate an escape JSON string as the value, when I actually want an object.

Is there any way to override GSON in favor of Jackson, or any other way to handle this scenario?

AB#8306228

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions