eclipse-vertx / vertx-codegen

Vert.x code generator for asynchronous polyglot APIs
Apache License 2.0
105 stars 92 forks source link

JSON converter case formatting #303

Closed vietj closed 4 years ago

vietj commented 4 years ago

This feature implements the choice of a different case than lower camel case for JSON member naming in converter generation. E.g

@DataObject(generateConverter = true, jsonPropertyNameFormatter = SnakeCase.class)

generates:

case "foo_bar_juu":
  if (member.getValue() instanceof String) {
    obj.setFooBarJuu((String)member.getValue());
  }
  break;

instead of

case "fooBarJuu":
  if (member.getValue() instanceof String) {
    obj.setFooBarJuu((String)member.getValue());
  }
  break;