Closed osher closed 8 years ago
perhaps the problem is with swagger project generate
it gave me swagger-restify-mw@0.1.0
I upgraded to @0.7.0
, same code as above.
and now, for the /hello?name=scott
I get:
{"message":"req.query must be provided for 'query' parameters"}
hu...?
well. at least the 'after'
is fired... :stuck_out_tongue:
Did you add "swagger_params_parser" to your swagger_controllers? See: https://github.com/theganyo/swagger-node-runner/releases/tag/v0.6.0.
I see. Done :)
By the way - there are 2 small error in the instructions on the link you provided:
_swagger_params_parser: # <= Add this definition
name: swagger_params_parser
jsonOptions: {}
urlencodedOptions:
extended: false
multerOptions:
inMemory: true
textOptions:
type: */*
type: */*
- does not compile for me. type: "*/*"
does.name: swagger_params_parser
are indented one level too much, and thast does not compile too (complains at jsonOption: {}
).here's the part that works for me:
openapi_params_parser:
name: swagger_params_parser
jsonOptions: {}
urlencodedOptions:
extended: false
multerOptions:
inMemory: true
textOptions:
type: "*/*"
ah, right. I name it openapi_params_parser
instead of _swagger_params_parser
, but that's just semantics.
FYI.
Original title:
app.on('after', ...) does not get called
Hi.
I'm using a
swagger project create -f restify
boilerplate, and I've been moving on from there.I found that connecting the
restify.auditLogger(..)
middleware by the book does not work. It appears that the'after'
event does not get fired.app.js:
Output:
First, I thought it's because the generated controllers do not call next. So I added a call to next:
api/controllers/hello_world.js
It did not do the trick: kept working the same.
Any help?