swagger-mock-api
swagger-mock-api copied to clipboard
YAML files, are building?
When I try YAML files, Grunt can't execute "connect" command, if I change the file for JSON it works fine.
bruno@bruno-VirtualBox:~/Documentos/repositorio/PlataformaWeb/api/mock$ grunt Running "connect:server" (connect) task Waiting forever... Started connect web server on http://localhost:8000 Fatal error: Cannot read property 'default' of undefined
That's the grunt file
'use strict';
var path = require('path');
var mockApi = require('swagger-mock-api');
module.exports = function(grunt) {
grunt.initConfig({
connect: {
server: {
options: {
keepalive: true,
middleware: [
mockApi({
swaggerFile: path.join(__dirname, "..", "specs/financial/financing-proposal/financing-proposal.yaml"),
watch: true // enable reloading the routes and schemas when the swagger file changes
})
],
},
},
},
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['connect']);
};
Interesting... I've got a hunch, I'll try to take a look at it in a day or so. It's probably a defect in swagger-parser
, since the file path itself is just passed straight through to that library.
Currently, this library is a good major version behind swagger-parser
, so I'll try to reproduce and see if a version bump fixes it.
If I don't see anything obvious, I may hold out a little bit as version 4 of swagger-parser
is in beta right now and should bring some nice features as well.
+1, facing the same issue.
same issue +1
bump