carbond.ParameterParser

An HTTP parameter parser class that parses any parameters defined on an operation and its parent endpoint on the current request. The parsed parameter values are stored on parameters.

Methods

parseParameterValue  
Arguments
  • datum (Object | string) – The parameter representation as plucked from the current request
  • definition (OperationParameter) – The parameter descriptor
Returns The parsed parameter value
Return type Object | string | number
Description Parse a single parameter
processParameter  
Arguments
Return type undefined
Description Parse a single parameter on the current request as defined by the “definition” parameter
processParameters  
Arguments
  • req (Request) – The current request
  • definitions (OperationParameter[]) – An array of parameters to parse from the current request
Return type undefined
Description Parse all parameters on the current request that are included in the OperationParameter definitions list
processParameterValue  
Arguments
  • datum (Object | string) – The parameter representation as plucked from the current request
  • definition (OperationParameter) – The parameter descriptor
Returns The parsed and validated parameter value
Return type Object | string | number
Description Process (i.e., parse and validate) a single parameter