Question

I'm able to generate REST API documentation via enunciate and I really like the example xml and json it generates for the message bodies. I can't find how to get it to generate those for lists, arrays, maps, etc. though.

I'm using maven, configured with enunciate plugin (regular) with the docs goal within the build plugins maven node.

Is this possible?

Thanks.

Was it helpful?

Solution

Unfortunately, Enunciate doesn't support this at the moment.

The reason is historical. Enunciate was written before JSON got all popular, so the original design was to document only Web services that returned JAXB objects. Support for JSON was added later, and has been enhanced multiple times since then.

Even today, Enunciate's JSON support feels like a second-class citizen because it's only supported on POJO and even then it's based on the JAXB annotations instead of, for example, the Jackson annotations. Work still needs to be done to make JSON a first-class citizen, but that effort is hampered by the fact that there is no Java standard JSON annotation set (like the JAXB annotation set). So if the work were done today, it would have to be tied to a specific JSON library implementation (probably Jackson).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top