diff --git a/package-lock.json b/package-lock.json index e49dfa46..fdbabe90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "express-openapi-validator", - "version": "2.8.0", + "version": "2.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 781e0bc1..a39d64b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-openapi-validator", - "version": "2.8.0", + "version": "2.8.1", "description": "Automatically validate API requests using an OpenAPI 3 and Express.", "main": "dist/index.js", "scripts": { diff --git a/src/framework/util.ts b/src/framework/util.ts index 403de5ca..34dbcfa1 100644 --- a/src/framework/util.ts +++ b/src/framework/util.ts @@ -28,12 +28,7 @@ export function loadSpecFile(filePath) { if (typeof filePath === 'string') { const absolutePath = path.resolve(process.cwd(), filePath); if (fs.existsSync(absolutePath)) { - try { - // json or module - return require(absolutePath); - } catch (e) { - return fs.readFileSync(absolutePath, 'utf8'); - } + return fs.readFileSync(absolutePath, 'utf8'); } } return null;