Param

The general format for a param tag is as follows:

@param where:<location> type:<datatype> name:<name> [additional flags] | <description>

Arguments

where: specifies where the argument comes from. This can be path, query, etc.

Here's an example of how you might use where::

@param where:path type:string name:variable | The environment variable

In this example, variable is an argument that will be obtained from the path.

Have a look at the function arguments section for more information.

The type: part specifies the datatype of the argument. This can be string, number, etc. This determines how the argument will be interpreted by the function.

It's useful to specify the type here, as it will be automatically converted to the correct type, or throw an error to the user if it's invalid.

@param where:query type:number name:id | The cat's id

In this example, id is an argument that will be obtained from the query string and interpreted as an number.

Have a look at the function arguments section for more information.

The name: part specifies the name of the argument. This is the identifier that will be used to reference the argument in your function.

This MUST be the same as the name of the argument in your function. If it's not, the argument will not be passed to your function.

@param where:header type:string name:authorization | Authorization

In this example, authorization is an argument that will be obtained from the header and passed to the function parameter authorization.

The contentType: part specifies the content type of the argument. This is only used for body arguments.

@param where:body type:object contentType:application/json name:body | The request body

In this example, body is an argument that will be obtained from the body of the request and interpreted as a json object.

Flags

There are additional optional flags that can be used to provide more information about the parameters.

This flag signifies that the parameter is not required.

@param where:path type:number name:id optional | The cat's id

In this example, id is an optional argument.

This flag signifies that the parameter is deprecated and should not be used.

@param where:path type:number name:id deprecated | The deprecated cat's id

In this example, id is a deprecated argument.

Description

Lastly, the | symbol is used to separate the parameter specification from its description.

@param where:path type:number name:id optional | The cat's id

In this example, The cat's id is the description of the id argument.