schema-dictated generic collection class?

9 views
Skip to first unread message

Neil Goldman

unread,
Feb 3, 2022, 6:40:01 PM2/3/22
to jsonschema2pojo-users
The ArrayRule.apply method has wired into it logic that produces one of two possible generic Collection classes to use as the translation of the schema -- either Set or List.

The application for which I am generating code needs to use a different generic collection class as the translation  MyCustomCollection<elementType>

I suppose I can write a class that extends  ArrayRule and override the apply method, or just postprocess the output and change the generic Type from Set/List to may own type.

But it seems odd to me that there is nothing I can put in the schema itself (something like placing "existingJavaGeneric" : "foo.bar.MyCustomCollection" ) to force the use of a specific generic type in the translation.

Am I missing some alternatative?
Reply all
Reply to author
Forward
0 new messages