krakenjs / swaggerize-routes

Swagger document driven route builder.
Other
58 stars 57 forks source link

It seems readhandler.js can not build some paths combinations #82

Open G940 opened 7 years ago

G940 commented 7 years ago

Hi there, I found an error like the following: If I have the following paths combinations=> /QItem: post + put /QItem/search: get /QItem/popular: get

the code in function read(dir) will not coorrectly build the right handlers object:

        if (stat.isDirectory()) {
               //handlers[key] = read(abspath);    //<= the latter /QItem/xxx seems override the previous /QItem
      Object.assign(handlers[key], read(abspath)); // <= do we have to change to this kind of objects merging?
        }
    });