-
Notifications
You must be signed in to change notification settings - Fork 414
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
Update swagger-initializer.js #2543
base: master
Are you sure you want to change the base?
Conversation
```javascript | ||
window.onload = function() { | ||
//<editor-fold desc="Changeable Configuration Block"> | ||
|
||
// the following lines will be replaced by docker/configurator, when it runs in a docker-container | ||
window.ui = SwaggerUIBundle({ | ||
spec: location.host, | ||
urls: [{"url":"http://"+location.host+"/swagger/serve.swagger.json","name":"RayServe Service"}, | ||
{"url":"http://"+location.host+"/swagger/error.swagger.json","name":"Errors API"}, | ||
{"url":"http://"+location.host+"/swagger/job.swagger.json","name":"RayJob Service"}, | ||
{"url":"http://"+location.host+"/swagger/config.swagger.json","name":"ComputeTemplate Service"}, | ||
{"url":"http://"+location.host+"/swagger/cluster.swagger.json","name":"Cluster Service"}], | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIStandalonePreset | ||
], | ||
plugins: [ | ||
SwaggerUIBundle.plugins.DownloadUrl | ||
], | ||
layout: "StandaloneLayout" | ||
}); | ||
|
||
//</editor-fold> | ||
}; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be inlined, since the actual file is already hyperlinked. It just means one more thing to update.
urls: [{"url":window.location.protocol+"//"+location.host+"/swagger/serve.swagger.json","name":"RayServe Service"}, | ||
{"url":window.location.protocol+"//"+location.host+"/swagger/error.swagger.json","name":"Errors API"}, | ||
{"url":window.location.protocol+"//"+location.host+"/swagger/job.swagger.json","name":"RayJob Service"}, | ||
{"url":window.location.protocol+"//"+location.host+"/swagger/config.swagger.json","name":"ComputeTemplate Service"}, | ||
{"url":window.location.protocol+"//"+location.host+"/swagger/cluster.swagger.json","name":"Cluster Service"}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns http:
or https:
depending on which protocol you're using.
cc @YQ-Wang would you mind reviewing this PR? Thanks! |
Why are these changes needed?
If the service is behind an HTTPS endpoint, you cannot load the swagger-ui
Related issue number
Closes #2542
Checks