Here is an example of writing documentation for a simple class.
Notes:
The resulting object name in this case will be city (lowercase of class name). If you want to override it, just specify a custom name in the name property of the annotation
Not writing a description for fields will result in a hint in the documentation (and in an informative message in the JSONDoc UI)
Documenting objects that won't be shown but will be considered in building documentation
Superclasses are not always needed from an API user perspective. They are still needed to build an effective documentation though. Here is how to do it:
Notes:
The object is annotated with show = false, indicating that this object will take part to the documentation build process, but it will not be shown as a stadalone object in the resulting documentation
Hibernate validator intergration
If JSONDoc finds Hibernate validator libraries on the classpath, it will trigger the scan for its annotations put on objects' fields. It will then extract data from them and use them to display validation rules in the JSONDoc UI. Currently JSONDoc supports these Hibernate validator annotations: