{"size": 615, "ext": "js", "max_stars_repo_path": "examples/swaggerJson/index.js", "max_stars_repo_name": "jeanycyang/swagger-group-by-tags-to-grafana-panels", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "examples/swaggerJson/index.js", "max_issues_repo_name": "jeanycyang/swagger-group-by-tags-to-grafana-panels", "max_issues_repo_issues_event_min_datetime": "2021-05-09T23:14:22.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-09T23:14:22.000Z", "max_forks_repo_path": "examples/swaggerJson/index.js", "max_forks_repo_name": "jeanycyang/swagger-group-by-tags-to-grafana-panels", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 25.625, "max_line_length": 76, "alphanum_fraction": 0.6308943089}
const { convertToStruct } = require('../../swaggerJson/convertToStruct.js');

const { convertToPanels } = require('../../swaggerJson/convertToPanels');

const { panel, target } = require('./statusesGraph');

(async () => {
  const groups = await convertToStruct({
    specFile: './examples/swaggerJson/swagger.example.json',
  });
  console.log(groups);
  const result = convertToPanels({
    dashboard: { title: 'auto generated using swagger json' },
    groups,
    panelModels: [{
      name: 'Statuses',
      panel,
      type: 'graph',
      target,
    }],
  });
  console.log(JSON.stringify(result));
})();
