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

Swagger UI not displayed #51

Open
oprince opened this issue Jan 11, 2017 · 7 comments · May be fixed by #84
Open

Swagger UI not displayed #51

oprince opened this issue Jan 11, 2017 · 7 comments · May be fixed by #84

Comments

@oprince
Copy link

oprince commented Jan 11, 2017

When loading Node-red UI in chrome, following exception is printed in browser console:

Uncaught TypeError: Cannot read property 'type' of undefined
at Object. (swagger-ui.js:254)
at Object.10 (swagger-ui.js:778)
at Object.f [as inverse] (handlebars-2.0.0.js:27)
at Object. (handlebars-2.0.0.js:27)
at Object.9 (swagger-ui.js:773)
at Object.f [as inverse] (handlebars-2.0.0.js:27)
at Object. (handlebars-2.0.0.js:27)
at Object.main (swagger-ui.js:789)
at e (handlebars-2.0.0.js:27)
at s.render (swagger-ui.js:26072)

@knolleary
Copy link
Member

Hi - what versions of node.js / node-red / node-red-node-swagger ui are you using?

You've been using the swagger node for some time. Is this the first time you've tried it on Chrome?

@oprince
Copy link
Author

oprince commented Jan 12, 2017

Hi,

The versions I use are
Node.js: 4.4.7
node-red: 0.14.6
node-red-node-swagger: 0.1.8

I have another project running on the same environment (with Chrome), for which Swagger-UI is displayed correctly.

Seems to be a problem in flows file.
I have found an error in method swagger.checkWiresForHttpResponse . There was a case were the wired node was null, causing exception at line

if(newNode.type == "http response")

So, I tried deleting the flow which is leading to that error, but it did not help much.
Can I send you the flows file by mail ?

@oprince
Copy link
Author

oprince commented Jan 12, 2017

The problem was solved in swagger-ui module
file: swagger-ui.js
method: Handlebars.registerHelper
replace the following line:
var paramType = param.type || param.schema && param.schema.type || '';
with the fixed line:
var paramType = (param.schema) ? param.type || param.schema.type || '' : param.type || '';

@oprince oprince closed this as completed Jan 12, 2017
@knolleary
Copy link
Member

Please do share the flow file.

Is it one you've manually generated somehow? Does it involve subflows?

... ok, I see you've just closed this having manually fixed something... Does that mean there's nothing for us to do? Does this fix need applying somewhere?

@oprince
Copy link
Author

oprince commented Jan 12, 2017

I have created pull request in swagger-ui repository:
swagger-api/swagger-ui#2607

The flow was edited only with node-red editor. Yes, it contains subflows. Sending by mail.

@knolleary
Copy link
Member

Ok, so we better leave this open so we pick up the fixed swagger-ui when it gets resolved.

@knolleary knolleary reopened this Jan 12, 2017
@JonSilver
Copy link
Contributor

Alas this one won't get resolved this way because the swagger-ui PR submitted by @oprince was rejected due to the changes being made to the dist folder not the source.

@fasblom fasblom linked a pull request Feb 6, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants