Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with latest version of swagger-tools/json-refs #18

Closed
antxxxx opened this issue Feb 10, 2016 · 6 comments
Closed

problem with latest version of swagger-tools/json-refs #18

antxxxx opened this issue Feb 10, 2016 · 6 comments

Comments

@antxxxx
Copy link

antxxxx commented Feb 10, 2016

Not sure if the problem is in this code, or downstream in swagger-tools or json refs, but...

swagger-tools has been updated to version 0.9.14 which uses the latest version of json-refs - 2.1.5

This module specifies to use ^0.9.0 of swagger-tools so if you do a clean install it gets version 0.9.14 of swagger-tools and version 2.1.5 of json-refs

If you deploy a proxy to apigee edge with these versions, you get this errors when you try to call it

TypeError: Expected argument of type object, but instead had type object at clone (/organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/index.js:69) at /organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/index.js:70 at clone (/organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/index.js:69) at /organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/index.js:1165 at notifyIsolated (/organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/node_modules/native-promise-only/lib/npo.src.js:120) at notify (/organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/node_modules/native-promise-only/lib/npo.src.js:97) at drain (/organization/environment/api/node_modules/a127-magic/node_modules/swagger-tools/node_modules/json-refs/node_modules/native-promise-only/lib/npo.src.js:67) at processImmediate (timers.js:345)

@whitlockjc
Copy link
Member

That error is somewhat cryptic in it says the argument should be an object but it found an object. I think this could be a Trireme thing so I'm going to point you to a blog post published yesterday on a utility we wrote to help diagnose these things outside of Apigee Edge: http://apigee.com/about/blog/developer/developing-nodejs-apigee-edge Use the information that blog to use the Apigee Edge Like Launcher for Node.js to see if you can reproduce this outside of Apigee Edge.

I'm assuming this runs fine with Node.js?

@antxxxx
Copy link
Author

antxxxx commented Feb 12, 2016

Yeah - it runs fine using node.js (version 0.10.32) but does fail when running locally using trireme.

In case anybody else does come across this, a workaround is to force usage of swagger-tools version 0.9.11 by putting a reference to that in the main package.json of the node app you want to run on Apigee

@antxxxx
Copy link
Author

antxxxx commented Feb 12, 2016

I have managed to track this down to an entry in our swagger.yaml file. If we have an empty value in there, then it fails in triereme. If we just remove the empty value, then it works

So we have a line with

x-a127-config:

then it fails. Removing these allows it to work running under node and trireme

@antxxxx
Copy link
Author

antxxxx commented Feb 12, 2016

Have also created issue on trireme
apigee/trireme#146

@whitlockjc
Copy link
Member

Thanks for chasing this down. I do think this is a Trireme bug so unless you object, we can close it here because there's nothing to be done here.

@antxxxx
Copy link
Author

antxxxx commented Feb 12, 2016

Thats fine - will close it

@antxxxx antxxxx closed this as completed Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants