swagger-node-runner
                                
                                
                                
                                    swagger-node-runner copied to clipboard
                            
                            
                            
                        mockModeNoCallback option and controller cache
Please see my question about context.headers[] before merging.
- mockModeNoCallback config option. Swagger examples show res.end() in the controllers while mock mode use cb(). This makes a huge difference for projects using custom fitters after the router.
 - Return content-type header on Accept: /
 - Simple default content-type detection
 - Place auto-generated mock controller function in cache
 - Made logging a bit more verbose
 - ignoreMissingHandlers option as described in swagger-tools router docs
 
Sorry for the bundled pull request ;)
Coverage decreased (-1.05%) to 95.902% when pulling 533a18d568a6b8cdfe10217677a3d57b21df73cd on moander:feature/router-stuff-1 into cc89cb2b7e6964cb1579ce2ec47f65175924a5c4 on theganyo:master.
Coverage decreased (-1.5%) to 95.447% when pulling a944384bebaf23111c47028ac99cb4d044d2d1c5 on moander:feature/router-stuff-1 into cc89cb2b7e6964cb1579ce2ec47f65175924a5c4 on theganyo:master.
Thanks for your contribution. Would you be able to provide any tests to verify your work?
Swagger examples show res.end() in the controllers while mock mode use cb(). This makes a huge difference for projects using custom fitters after the router.
I think it's a deceiving problem, we need to fix these examples. In this sense, they just show what not to do...
The fact that the examples assume there is no handler down the pipeline after them is not known to readers - hence the deception