apigee-127 / swagger-node-runner

The heart of Swagger-Node
MIT License
102 stars 123 forks source link

Convert Buffer to String before validation #59

Closed oimou closed 7 years ago

oimou commented 8 years ago

Motivation

In hookResponseForValidation function, validation fails when body is a Buffer.

Changes

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.006%) to 96.321% when pulling d888ceada01c23f4205f7ce063f6d541f8791b1c on oimou:master into 07a706f461833ca1642981a61c8ce72e6a8a260b on theganyo:master.

321ckatz123 commented 8 years ago

+1

theganyo commented 7 years ago

I think this actually might be better addressed in the underlying library, Sway. @whitlockjc?

whitlockjc commented 7 years ago

I'm cool with handling this in sway. Let me create an issue and link this one.

theganyo commented 7 years ago

👍

whitlockjc commented 7 years ago

Might as well keep this open, or create a new issue, to track the work happening in sway.

whitlockjc commented 7 years ago

This is a non-issue. Long story short, sway does type coercion but type coercion only works if the type is known. This means that when you do not specify a type, like in the example that caused this issue, this issue will happen. (Please see https://github.com/apigee-127/sway/issues/45 for more details.)

theganyo commented 7 years ago

Thanks, @whitlockjc!