vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jackson2Configuration.serializerTypeMappings not working for JsonSerialize and keyUsing

stefanrybacki opened this issue · comments

It seems jackson2Configuration.serializerTypeMappings only works for JsonSerialize.using (maybe contentUsing also, did not test that) but not with keyUsing.

Current plugin version is: 3.1.1185

Example for the following class:

public class Test {
  @JsonSerialize(keyUsing=XSerializer.class)
  field: Map<X, Y>;
}

generates the following ts:

interface Test {
  field: { [P in X]?: Y };
}

when setting the following in gradle:

    jackson2Configuration = [
      'serializerTypeMappings': [
        'XSerializer:string'
      ]
    ]

I would expect the following ts:

interface Test {
  field: { [index: string]: Y };
}

but still get the ts shown without configuration.