sdaschner / jaxrs-analyzer

Creates REST documentation for JAX-RS projects
Apache License 2.0
319 stars 101 forks source link

Preserve order of properties when creating swagger spec #123

Open abstratt opened 6 years ago

abstratt commented 6 years ago

jaxrs-analyzer should honor the order of properties specified in the JAXB model classes.

In XML a change in order means a change in syntax of the XML representation.

I saw #34. There may be cases where sorting is nice (status codes), but it should not be done for object representations.

@darylteo made very compelling arguments for preserving order in #55 (in that case, for parameters). One counter-argument was to preserve a deterministic order - using a LinkedHashMap instead of a Map to store properties takes care of that.

Extra points for supporting the propOrder attribute in XmlType annotations.