Skip to content

@Param does not allow ParamOptions #306

Closed
@IAMtheIAM

Description

@IAMtheIAM

Signature for Param is

export declare function Param(name: string): Function;

But signature for QueryParam is

export declare function QueryParam(name: string, options?: ParamOptions): Function;

This is problematic because, by default, in useExpressServer() i have set

    defaults           : {
        paramOptions: {
            required: true // this means that all parameters (@BodyParam, @Param etc in Actions) are required by default
        }
    }

so that all params are required. Then I manually override with @QueryParam("mockData", { required: false }) mockData: boolean

But Param will not accept the second argument.

Can Param signature be modified to allow ParamOptions like the rest?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions