Parameter validation¶
By default, Refinery has a number of parameter validation checks at both the GW and DB levels, across the supported API arguments as outlined in the relevant API documentation. These checks are intended to report useful errors back to end users and prevent unnecessary failed query execution against downstream processes.
In certain circumstances, it may be desirable to disable these checks. For example, you may wish to disable columns checks when running querying for aliased columns which exist on downstream processes, which are not described in the base table schema (and would thus fail validation).
Warning
It is recommended to NOT disable any validation unless required for a specific use case.
Disabling parameter validation¶
To disable a specific parameter validation check, each of the below must occur;
-
apiValidationDisabledflag must be enabled at the GW entrypoint for a given API -
doNotValidateparameter must be supplied with the specific parameter to disable within the args for a given API call
Updating GW API Validation¶
To update the GW apiValidationDisabled dictionary, a function is provided on the GW entrypoint process which allows toggling of the API validation checks per API. Add the code below to a custom library that gets loaded into the defaultEntrypoint GW (gw.*.q):
.api.config.disableApiValidation[`getTicks;1b]
Adding this is the first step in allowing the GW to disable the specific API paramters from being checked and thus allowing a bypass of any aliased column names.
Updating API args¶
Provided that .daas.cfg.apiValidationDisabled[apiFunction] returns 1b on your GW entrypoint process, you can proceed with disabling specific validation checks using doNotValidate within the args component of an API call. For example, assume the following returns 1b:
gw(`.daas.cfg.apiValidationDisabled;`getTicks)
We can then send a query to the GW and ignore validating columns as follows;
gw(`getTicks;`dataSource`dataType`startDate`endDate`idList`columns`doNotValidate!(`source; `dataType; .z.d-1; .z.d; `; `symcol`timecol`doesNotExist;`columns))
Supported parameter disabling reference¶
| parameter | getStats | getTicks |
|---|---|---|
| analytics | x | |
| applyFilter | x | x |
| columns | x | |
| idType | x | x |
| sortCols | x | x |
| byCol | x | x |
x = valid
The table shows what parameter checks can be disabled.