Skip to content

Code gen: Check or autoadd @DateTimeJsonConverter attribute #4

Description

@greymag

Problem

Default date json to/from converter saves date in local time zone. That's dangerous, especially when we synchronise entries between the devices. So we need to save date in UTC. We have custom DateTimeJsonConverter, but for it to work it needs to be added manually as attribute of every entry class. It's not convenient and easy to forget.

What to do

There are 2 main ideas. Both working when user run alex code gen.

First: check that all the @JsonSerialized classes has attribute, if not - print bad classes and fail.

Second: automatically add attribute @DateTimeJsonConverter to the all @JsonSerialized. It's more convenient, but may be hard to implement.

Of course we need an options in alex configuration to enable/disable this behaviour (enabled by default).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions