JSON format annotation support

61 views
Skip to first unread message

Madhur Kamalapurkar

unread,
Sep 5, 2016, 7:08:22 PM9/5/16
to jsonschema2pojo-users
Hi All,

I think there is no support for @JsonFormat in org.jsonschema2pojo project. If it is already present then please let me know how can I achieve that but as far as I know there is PR pending from July 2015 on this and no progress.

A message to creators, please let me know if I can contribute if the annotation support is not present in the library.

Regards,
Madhur Kamalapurkar

Joe Littlejohn

unread,
Sep 6, 2016, 12:54:04 PM9/6/16
to jsonschema...@googlegroups.com
Could you explain what you are trying to do with @JsonFormat?

If you need dates to be output with a certain pattern by your serializer, you can configure the Jackson to do this yourself.



--
You received this message because you are subscribed to the Google Groups "jsonschema2pojo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonschema2pojo-users+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.

Madhur Kamalapurkar

unread,
Sep 7, 2016, 4:17:53 PM9/7/16
to jsonschema2pojo-users
Hi Joe,

Thanks for the response. Yes, I tried the Jackson way but I wanted detailing at field level so I asked this question. I want JsonFormat to format the dates. As of now Jackson returns in epoch timestamp miliseconds.

Thanks,
Madhur

Madhur Kamalapurkar

unread,
Sep 8, 2016, 4:23:32 PM9/8/16
to jsonschema2pojo-users
Hi Joe,

To add to the above, I'm using Spring 4 and Jackson 2 and there seems to be some issue with the overriding the date format and object mapper. So, I needed this support. Let me know your thoughts on this.

Ref: http://stackoverflow.com/questions/33456325/how-to-remove-write-as-timestamp-and-set-date-format-in-spring-4-and-jackson-2

Regards,
Madhur Kamalapurkar

Jayaprabahar Chandrasekaran

unread,
Jun 27, 2022, 1:41:05 PM6/27/22
to jsonschema2pojo-users
Hi,

I am facing the same issue. Could you tell me how did you achive the result

Reply all
Reply to author
Forward
0 new messages