An interface for a validator of a URL query parameter.
// validates a search keywords parameter.class KeywordsUrlQueryParameterValidator implements ApiXUrlQueryParameterValidator { isValid(name: string, value: string): boolean { // keyword are only alphanumeric with limited punctuation. Example only. const regex = /^[a-zA-Z0-9.,'" ]+$/; return regex.test(value); }} Copy
// validates a search keywords parameter.class KeywordsUrlQueryParameterValidator implements ApiXUrlQueryParameterValidator { isValid(name: string, value: string): boolean { // keyword are only alphanumeric with limited punctuation. Example only. const regex = /^[a-zA-Z0-9.,'" ]+$/; return regex.test(value); }}
Determines whether the value for the parameter is valid.
The name of the parameter to validate.
The value of the parameter to validate.
true if the parameter is valid and false otherwise.
true
false
An interface for a validator of a URL query parameter.
Example