openfire-restAPI-plugin
openfire-restAPI-plugin copied to clipboard
For all entities, add schema annotation to all (XML) elements
We should add an io.swagger.v3.oas.annotations.media.Schema
(or equivalent, such as @ArraySchema
) annotation to each property of an entity (typically, those are the getter methods that are already annotated with @XmlElement
).
This will allow for the auto-generated documentation to be enriched with a description of the property. Many of these descriptions are already available. They have been painstakingly added manually in the readme.md
file. The can mostly be copied from there.
For example, a method like this:
/**
* Gets whether this is a shared group
*
* @return whether it's a shared group
*/
@XmlElement(name = "shared")
public Boolean getShared(){ return shared; }
Should be annotated as follows:
/**
* Gets whether this is a shared group
*
* @return whether it's a shared group
*/
@XmlElement(name = "shared")
@Schema(description = "Whether the group should automatically appear in the rosters of the users", example = "false")
public Boolean getShared(){ return shared; }