I'm using enunciate to generate Swagger documentation for a REST API. One of my legacy beans contains a Map, and Swagger complains about this:
[INFO] --- maven-enunciate-plugin:1.27:docs (default) @ foo-api ---
[INFO] initializing enunciate.
[INFO] invoking enunciate:generate step...
[WARNING] Validation result has errors.
/.../rest/BarBean.java:170: [swagger] Swagger isn't smart enough to handle anonymous types (such as maps).
public HashMap<String, BazBean> getBazBeans() {
Are there any annotations I can drop into the bean class so that Swagger can handle this?
Barring that, is there a way to tell Swagger to simply ignore the field or the whole class? I know that Swagger ignores classes without the @XmlRootElement
annotation, but BazBean
is tragically used in another endpoint that accepts XML.