How to generate Javadocs for enums?

92 views
Skip to first unread message

tippe...@googlemail.com

unread,
Apr 30, 2019, 6:45:05 AM4/30/19
to jsonschema2pojo-users
Is there a way to generate Javadoc entries for the enums that are at the root level and also for individual values within an enum?

{
       
"type" : "string",
       
"title": "MyEnumTitle",
       
"description": "Some description of my enum.",
       
"enum" : ["one", "secondOne", "3rd one"]
}

The above json does not cause either the title or description to be created for the enum.  However, the following does generate docs:

{
       
"type" : "object",
       
"properties" : {
           
"myEnum" : {
               
"title": "MyEnumTitle",
               
"description": "Some description of my enum.",
               
"type" : "string",
               
"enum" : ["one", "secondOne", "3rd one"]
           
}
       
}
}




Also, is it possible to associate documentation with each entry in the enum?  I'm working with an externally defined schema where the enum values I'll be parsing are not intuitive, e.g. AMCH = AddressMatch, so it would be nice to be able to have "AddressMatch" in the docs for the enum.

Many thanks,

John

tippe...@googlemail.com

unread,
Apr 30, 2019, 1:26:02 PM4/30/19
to jsonschema2pojo-users
It looks like the library does not support Javadocs titles and descriptions for root-level enums.  I have raised issue #975 (https://github.com/joelittlejohn/jsonschema2pojo/issues/975), with a corresponding PR here (https://github.com/joelittlejohn/jsonschema2pojo/pull/976).

Joe Littlejohn

unread,
May 1, 2019, 11:19:28 AM5/1/19
to jsonschema...@googlegroups.com
Thanks John, I've merged your PR and this will be released in 1.0.2.

--
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-...@googlegroups.com.
Visit this group at https://groups.google.com/group/jsonschema2pojo-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages