FoD: Review `FoDFiltersParamGenerator` configurations
Ideally, all commands for which the primary FoD API endpoint supports the filters request parameter should allow for server-side filtering, both providing automated server-side query-functionality based on -q/--query option, and the explicit --filters-param option to allow users to manually specify/override the filters request parameter.
To support server-side filtering, commands must have the following:
implements IServerSideQueryParamGeneratorSupplieron the command class; this interface gets implemented by the@Getter ... serverSideQueryParamGenerator@Mixin private FoDFiltersParamMixin filterParamMixin;; this mixin provides the--filters-paramoption and handles updating the request with thefiltersparameter with either value of--filters-paramor auto-generated value@Getter private IServerSideQueryParamValueGenerator serverSideQueryParamGenerator = new FoDFiltersParamGenerator().add()...; defines the property names that are supported for auto-generated queries
Various commands already have these elements, but it looks like the various FoDFiltersParamGenerator configurations require some updates to properly support auto-generated queries on all properties supported by FoD.
Basically, for every property that is supported by the FoD filters parameter for a given endpoint, the command implementation should call the add method on FoDFiltersParamGenerator. The add method supports one or two method parameters:
- The property name as it may appear in fcli output and that can be used in client-side queries using the
-qoption. - Optional; usually only needed if the property was renamed in the fcli output, specifying the original property name / the property name that is expected by the
filtersparameter.
For example, if an FoD endpoint returns an applicationName property, this property is not being renamed in fcli, and the filters parameter supports server-side queries for this property, then FoDFiltersParamGenerator::add("applicationName") should be configured in the command.
If, on the other hand, fcli renames applicationName to name, then FoDFiltersParamGenerator::add("name", "applicationName") should be used instead, thereby renaming any client-side queries on name to server-side queries on applicationName.