-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Response validation of object bodies broken #25
Comments
Thanks. This should be addressed automatically when @whitlockjc updates Sway. |
This has been fixed in Sway but it will not be released immediately. I'm hoping to cut |
I've just tried manually forcing the sway dependency to sway#master, however swagger-node-runner is no longer compatible with, specifically as it relates to validating responses. This is due to breaking change apigee-127/sway@52d4c43. The relevant swagger-node-runner line is https://github.com/theganyo/swagger-node-runner/blob/master/lib/connect_middleware.js#L163. What is the plan for 1.0.0 regarding swagger-node-runner and sway? Are they going to be bumped together? Or is some of this going to be handled by the new sway-connect project? As it stands, there doesn't seem to be any way to do response validation, barring going back to swagger-node-runner 0.5.x. |
FWIW, I've created a fork which makes swagger-node-runner compatible with sway@master - irond13@e837376. I can submit a pull request if need be. |
Yes, it's unfortunate that Sway 1.0 broke compatibility, but since you've worked it out already, your PR is certainly welcome! No, there is no plan to incorporate Sway directly into this project nor to use sway-connect. But perhaps I just don't understand why you are suggesting that either of those would be good options? |
I didn't break things on a whim but for consistency, and I didn't take it lightly. Not only that but I was up front that the API can and will change up to |
@whitlockjc I wasn't blaming you for your choice to break compatibility, but if it seemed that way to you, I apologize. |
@theganyo my comments regarding swagger-node-runner/sway and 1.0.0 were more around whether you plan on bumping the sway dep to 1.0.x once it is released. As it stands, using the latest published minor range of swagger-node-runner (0.6.x), response validation of JSON objects is broken when using Express. It seems that there is no workaround other than using the latest sway version (or forking). Regarding the PR, I'll submit it as soon as sway 1.0.0 is published (at the moment, my fork has a sway dep. of sway#master). Do note that there are other breaking changes as well though, besides the response validation stuff mentioned above. There were also test failures for the mock and sample response features. I got all the tests passing again by making changes to both the tests and the swagger_router fitting (see irond13@e837376). Since this would also result in breaking compatibility for swagger-node-runner clients, this would mean swagger-node-runner would need at least a minor bump (arguably a major bump would be more appropriate). Hence why I asked whether swagger-node-runner would be matching the sway version bump :) @whitlockjc That makes perfect sense (the major bump definitely seems appropriate here). I'm just looking for the best way to get response validation working. Are there any outstanding pieces of work that are needed before sway 1.0.0 gets released? |
Gotcha. Most likely this will be a minor bump to 0.7.0, but nothing has been decided yet. |
@theganyo, not at all. Just providing context to those that don't work with me. :-) |
@theganyo: Any news on when you're upgrading to |
@theganyo I'm also curious if there is a plan for this. @irond13 Can you submit a PR for the changes you made? I suppose I can fork your changes and submit the PR if I need to. It would great to get the ball rolling on this with how long sway 1.0 has been out. I'm trying to use this library at work and I know I'd really like for the response validation on JSON objects to work so I can ensure my responses from my API server stay in-sync with my Swagger doc. I can try helping out any way that helps :). |
Okay, I went ahead and forked, cherry-picked @irond13 changes, and submitted a PR. This upgrades to sway 1.0.0. Looks like some CI failures occurred for node 0.12 and 0.10. I'll try to get those patched up as well. |
Okay, all checks are passing for v0.12 and v0.10 now. So I suppose it's ready for you to take a look if you wish @theganyo |
76f5051 seems to have broken response validation, since v. 0.6.0 of Sway can no longer validate JSON encoded strings as objects, see apigee-127/sway#48.
The text was updated successfully, but these errors were encountered: