Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
// if operation has an example, return its value
if (mediaResponse.example && mediaResponse.example.value) {
return mediaResponse.example.value;
}
// pick the first example from examples
if (examples) {
const exampleObject = examples[_.first(_.keys(examples))] as OpenAPIV3.ExampleObject;
return exampleObject.value;
}
if (schema) {
return mock(schema as OpenAPIV3.SchemaObject);
}
return defaultMock;
}