Files
threshold/website/lib/swagger-parser.js
T

8 lines
273 B
JavaScript
Raw Normal View History

2020-10-09 16:26:32 -04:00
const fs = require('fs')
const RefParser = require('@apidevtools/json-schema-ref-parser')
export default async function parseSchema(filePath) {
const content = JSON.parse(fs.readFileSync(filePath))
const schema = await RefParser.dereference(content)
return schema
}