swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

@JsonSerialize(using= Custom.class) ignored for schema & examples

Open redouane59 opened this issue 3 years ago • 0 comments

Hello,

I'm a new user of swagger-core and I didn't find a way to apply my custom deserializer object in my Example Value and Schema fields in swagger-ui. Currently, the initial object properties are shown and not the overrided ones.

Any idea ?

Here is the concerned class :

public class Word {
  @JsonSerialize(using = TranslationsDeserializer.class)
  private List<Translation> translations = new ArrayList<>();
... 
}

I would like the objected generated by TranslationDeserializer class to be returned instead of the native List<Translation>.

edit: I tried to replace the @JsonSerialize annotation by the @JsonComponent annotation directly in the Deserializer class and the result is still the same.

redouane59 avatar Jun 04 '22 17:06 redouane59