Hi all, While working on FINERACT-3179 (part of FINERACT-3175, returning typed objects from the API resources), the question came up whether the typed REST endpoints should keep the ?fields= partial response filter. Adam suggested raising it here, since dropping it is a breaking change.
Today, with the legacy Gson serializer: - ?fields=a,b returns only those fields, restricted to an allow-list per resource. - An unknown field name returns 400 (UnsupportedParameterException). When a resource returns typed objects through Jackson, neither applies anymore unless we add something for it: - ?fields= is ignored and the full object is returned. - An unknown field name returns 200. The open sub-task PRs currently take different approaches: - #6848 (FINERACT-3182) drops fields and removes the ?fields= examples from the Swagger descriptions. - #6875 (FINERACT-3183) keeps its report reads on String to keep fields. - #6845 (FINERACT-3188) proposes a PartialResponseFilter with a @PartialResponseParameters annotation that would keep both the filtering and the 400 on the typed path. The savings and GL account resources, converted earlier, already ignore fields on REST. For savings and for my loan charge PR (#6957), the Batch API keeps fields, since its strategies still serialize with Gson. The options I see: 1. Drop fields on the typed REST endpoints (breaking): document it in the release notes and remove the ?fields= examples from the Swagger descriptions. 2. Keep it through the filter proposed in #6845 and annotate each typed read with its allow-list. It would help to settle this once for the whole epic, so the remaining sub-tasks can follow the same approach. Does anyone rely on ?fields= today, or have a preference? I'm happy to update #6957 either way. Links: - FINERACT-3175: https://issues.apache.org/jira/browse/FINERACT-3175 - #6957: https://github.com/apache/fineract/pull/6957 Thanks, Aana
