Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend: serialise Java List objects as JSON List
Motivation: Various JAX-RS resources return a List as value. If the returned Java List happens to be a ArrayList then it is serialised as a JSON Object with the list being the value of some unspecified keyword; e.g., { "List" : [ item-1, item-2, ... ] } JSON supports returning lists, which is a better fit for describing a Java List; e.g., [ item-1, item-2, ... ] Currently there is inconsistent behaviour between different implementations of List. For example, an ImmutableList would be serialised as a JSON List. Modification: Update objectmapper to switch off the WRAP_ROOT_VALUE feature for ArrayList items. Result: The JSON output for the following requests is updated to return a JSON List rather than a JSON Object that wraps a list. GET /api/v1/alarms GET /api/v1/billing/grid/histograms GET /api/v1/selection/links GET /api/v1/selection/partitions GET /api/v1/selection/poolgroups GET /api/v1/selection/pools GET /api/v1/selection/unitgroups GET /api/v1/selection/units POST /api/v1/selection/match Target: master Require-notes: no Require-book: no Patch: https://rb.dcache.org/r/10542/ Acked-by: Tigran Mkrtchyan Acked-by: Albert Rossi
- Loading branch information