Skip to content

Set global field naming policy for Json serialization #743

@audkar

Description

@audkar

It would be convenient if we could set field naming policy for Json serialization globally.

I am aware that:

  • It is possible to change single field naming via BuiltValueField. But it is cumbersome to do this for thousands of fields. And more often devs wants to set global policy instead of having fields with different naming conventions.
  • It is possible to add additional serialization plugin for renaming. But that is not optimal from performance and logic side. Json plugin is responsible for converting dart objects to Json representation. It already does key name generation by looking into field name or using BuiltValueField value.

Every single json serializer I used with Java (GSON, Jackson, Moshi) have such functionality. So IMHO this is StandardJsonSerializer responsibility. WDYT?

related #144

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions