docs: function parseSwagger(swagger) {
    const { paths, components, info, servers, security } = swagger;
    const api = {};
  
    for (const path in paths) {
      for (const method in paths[path]) {
        const {
          operationId,
          summary,
          tags,
          parameters,
          requestBody,
          responses,
          security,
        } = paths[path][method];
  
        // make sure some props must exist
        if (!operationId)
          throw new Error(`missing operationId for ${method} ${path}`);
        if (!tags && !tags[0])
          throw new Error(`missing operation tag for ${method} ${path}`);
  
        // camelcase operationId
        const name = camelCase(operationId);
  
        // use 200/204 response, use http-errors as error responses. https://github.com/jshttp/http-errors
        const res200 = responses["200"] || responses[200];
        const res201 = responses["201"] || responses[201];
        const res202 = responses["202"] || responses[202];
        const res204 = responses["204"] || responses[204];
        const response = res200 || res201 || res202 || res204;
        if (!response)
          throw new Error(`missing 20X response for ${method} ${path}`);
  
        if (res200) {
          response.status = 200;
          response.content = get(response, ["content", "application/json"]);
        }
  
        if (res201) {
          response.status = 201;
          response.content = get(response, ["content", "application/json"]);
        }
  
        if (res202) {
          response.status = 202;
          response.content = get(response, ["content", "application/json"]);
        }
  
        if (res204) {
          response.status = 204;
          response.content = get(response, ["content", "application/json"]);
        }
  
        // requestBody
        if (requestBody) {
          requestBody.content = get(requestBody, ["content", "application/json"]);
        }
  
        // use tags[0] as api's name
        api[tags[0]] = api[tags[0]] || { name: tags[0], operations: [], ref: [] };
  
        api[tags[0]].operations.push({
          method,
          name,
          operationId,
          parameters,
          path,
          requestBody,
          response,
          summary,
          security,
        });
      }
    }
  
    return { info, servers, api, components, security };
  }