5

I'm consuming an api that uses lowercase_with_underscores naming convention for its jsons' properties:

{
  "user_id": 0,
  "full_name": ""
}

and my built_value class is:

abstract class User implements Built<User, UserBuilder> {
  //...
  @BuiltValueField(wireName: "user_id")
  int get userId;

  @BuiltValueField(wireName: "full_name")
  String get fullName;
  //...
}

is there a way to change built_value serializer naming convention for all built_value classes so that it automatically asigns my_property in json to myProperty in built_value model instead of using BuiltValueField(wireName: "my_property") for each property?

Mahdi Dahouei
  • 1,588
  • 2
  • 12
  • 32

0 Answers0