Aitozi commented on PR #218:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/218#issuecomment-1128768389
Thanks, I think I get what you mean, I tried a way to custom the serializer
may be can pass the null
```
@Test
public void test() {
var application = TestUtils.buildApplicationCluster();
Serialization.jsonMapper().registerModule(new TestModule());
System.out.println(Serialization.asJson(application));
}
public class TestModule extends SimpleModule {
public TestModule() {
super("CustomTestModule",
VersionUtil.versionFor(SavepointInfo.class));
addSerializer(SavepointInfo.class, new
SavepointInfoSerializer());
}
}
public class SavepointInfoSerializer extends JsonSerializer<SavepointInfo> {
@Override
public void serialize(
SavepointInfo savepointInfo,
JsonGenerator jsonGenerator,
SerializerProvider serializerProvider)
throws IOException {
jsonGenerator.writeStartObject();
if (savepointInfo.getTriggerId() == null) {
jsonGenerator.writeStringField("triggerId", null);
}
}
}
```
generated:
```
"savepointInfo":{
"triggerId":null
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]