routing-controllers icon indicating copy to clipboard operation
routing-controllers copied to clipboard

'isArray' does not exist in type 'ParamOptions'

Open sshd123 opened this issue 4 years ago • 4 comments

i use query param(array type) on controller,but when i debug in vscode, it raise error. query is :@QueryParam("models", { isArray: true}) models: string[] error is: Object literal may only specify known properties, and 'isArray' does not exist in type 'ParamOptions'

sshd123 avatar Jan 20 '22 02:01 sshd123

Here is the interface, it doesn't include isArray. Where do you see that is supported?

export interface ParamOptions {
    /**
     * If set to true then parameter will be required.
     * If user performs a request and required parameter is not in a request then routing-controllers will throw an error.
     */
    required?: boolean;
    /**
     * If set to true then parameter will be parsed to json.
     * Parsing is automatically done if parameter type is a class type.
     */
    parse?: boolean;
    /**
     * Class transform options used to perform plainToClass operation.
     */
    transform?: ClassTransformOptions;
    /**
     * If true, class-validator will be used to validate param object.
     * If validation options are given then class-validator will perform validation with given options.
     */
    validate?: boolean | ValidatorOptions;
    /**
     * Explicitly set type which should be used for param to perform transformation.
     */
    type?: any;
}

faridanthony avatar Jan 28 '22 14:01 faridanthony

Closing as stale.

attilaorosz avatar Mar 03 '22 17:03 attilaorosz

this wasnt released yet, is there any plan for releasing 0.10 rc1 ? https://github.com/typestack/routing-controllers/issues/798 or backward compatible this to 0.9 for better array support - https://github.com/typestack/routing-controllers/pull/677

talbSE avatar Mar 11 '22 09:03 talbSE

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 11 '22 00:04 github-actions[bot]