class "Outer" contains field of type "Inner" (interface, with concrete instance "InnerImpl")
InnerImpl contains one field
The serializer is configured with a custom filter which filters out that field
This causes InstanceSerializerImpl#serializeSubtypeInstance() to insert a "class" attribute into the JSON stream for InnerImpl, followed by a comma. Since InnerImpl does contain fields, that comma is not removed. But since all fields are filtered, the comma is not followed by another field either. => The generated JSON is invalid:
{"inner":{"class":"com.iisy.solvatio.common.util.BoonIssueTest$InnerImpl",}}
Scenario:
This causes InstanceSerializerImpl#serializeSubtypeInstance() to insert a "class" attribute into the JSON stream for InnerImpl, followed by a comma. Since InnerImpl does contain fields, that comma is not removed. But since all fields are filtered, the comma is not followed by another field either. => The generated JSON is invalid:
{"inner":{"class":"com.iisy.solvatio.common.util.BoonIssueTest$InnerImpl",}}
Problematic code location: https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/json/serializers/impl/InstanceSerializerImpl.java#L93
Unit test to reproduce the problem: