lib/server-code/model/service-descriptor.js
function enrichMethodNode(methodNode, method) {
  method.description && (methodNode.description = method.description)

  if (method.tags.route) {
    let httpPath = method.tags.route
    let httpMethod = 'GET'
    const sepPos = httpPath.indexOf(' ')

    if (sepPos !== -1) {
      httpMethod = httpPath.substr(0, sepPos).toUpperCase()
      httpPath = httpPath.substr(sepPos + 1)

      if (!isValidHttpMethod(httpMethod)) {
        throw new Error(`Unsupported HTTP method [${httpMethod}] for ${method.name} method`)
      }
    }

    methodNode.method = httpMethod
    methodNode.path = httpPath
  }

  return methodNode
}
function enrichMethodNode(methodNode, method) {
  method.description && (methodNode.description = method.description)

  if (method.tags.route) {
    let httpPath = method.tags.route
    let httpMethod = 'GET'
    const sepPos = httpPath.indexOf(' ')

    if (sepPos !== -1) {
      httpMethod = httpPath.substr(0, sepPos).toUpperCase()
      httpPath = httpPath.substr(sepPos + 1)

      if (!isValidHttpMethod(httpMethod)) {
        throw new Error(`Unsupported HTTP method [${httpMethod}] for ${method.name} method`)
      }
    }

    methodNode.method = httpMethod
    methodNode.path = httpPath
  }

  return methodNode
}
function enrichMethodNode ( methodNode , method ) { method . description && ( methodNode . description = method . description ) if ( method . tags . route ) { let httpPath = method . tags . route let httpMethod = 'GET' const sepPos = httpPath . indexOf ( ' ' ) if ( sepPos !== - 1 ) { httpMethod = httpPath . substr ( 0 , sepPos ) . toUpperCase ( ) httpPath = httpPath . substr ( sepPos + 1 ) if ( ! isValidHttpMethod ( httpMethod ) ) { throw new Error ( ` ${ httpMethod } ${ method . name } ` ) } } methodNode . method = httpMethod methodNode . path = httpPath } return methodNode }
Enriches service method node by adding 'method', 'route' and 'description' attributes.
@param {Object} methodNode
@param {Object} method
@returns {Object} methodNode
Enriches service method node by adding method route and description attributes .