Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parse(done) {
const {
Category, ParseResult, SourceMap,
} = this.minim.elements;
const swaggerParser = new SwaggerParser();
this.result = new ParseResult();
// First, we load the YAML if it is a string, and handle any errors.
let loaded;
try {
loaded = _.isString(this.source) ? yaml.safeLoad(this.source) : this.source;
} catch (err) {
this.createAnnotation(ANNOTATIONS.CANNOT_PARSE, null,
(err.reason || 'Problem loading the input'));
if (err.mark) {
this.result.first().attributes.set('sourceMap', [
new SourceMap([[err.mark.position, 1]]),
]);
}
/*global it: true, describe: true */
/*eslint no-console: 0*/
import pick from 'lodash.pick'
import should from 'should'
import sutro from '../src'
import request from 'supertest'
import express from 'express'
import Parser from 'swagger-parser'
const parser = new Parser()
const users = [
{ id: 0, name: 'foo' },
{ id: 1, name: 'bar' },
{ id: 2, name: 'baz' }
]
const passengers = [
{ name: 'todd' },
{ name: 'rob' }
]
const cars = [
[
{ id: 0, name: 'foo', passengers },
{ id: 1, name: 'bar', passengers },
{ id: 2, name: 'baz', passengers }
],