A Field May Have Values of Different Types

  • You can use field.doc to place possible type values in field comments.

Configuration is as follows:

 field.doc[#maybe]=groovy:it.docs("maybe").collect{helper.resolveLink(it)}.collect{"Possible types:\n\n```json\n" + it.toJson(true) +"\n```\n\n"}.join("\n")

Usage is as follows:

 /**
  * @maybe {@link UserInfo}
  * @maybe {@link java.lang.String}
  */
 public Object target;