Skip to content

Update swagger-initializer.js#2543

Merged
andrewsykim merged 3 commits intoray-project:masterfrom
metasyn:patch-1
Dec 11, 2024
Merged

Update swagger-initializer.js#2543
andrewsykim merged 3 commits intoray-project:masterfrom
metasyn:patch-1

Conversation

@metasyn
Copy link
Contributor

@metasyn metasyn commented Nov 14, 2024

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

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Comment on lines -102 to -128
```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>
};
```
Copy link
Contributor Author

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.

Comment on lines +7 to +11
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"}],
Copy link
Contributor Author

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.

@metasyn metasyn marked this pull request as ready for review November 14, 2024 21:03
@kevin85421
Copy link
Member

cc @YQ-Wang would you mind reviewing this PR? Thanks!

@kevin85421
Copy link
Member

gentle ping - @YQ-Wang @han-steve

Copy link
Contributor

@han-steve han-steve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@kevin85421
Copy link
Member

@metasyn would you mind rebasing the PR with the master branch?

@metasyn
Copy link
Contributor Author

metasyn commented Dec 7, 2024

I just updated it 👍

@andrewsykim andrewsykim enabled auto-merge (squash) December 11, 2024 17:52
@andrewsykim andrewsykim merged commit e4a9645 into ray-project:master Dec 11, 2024
19 checks passed
@metasyn metasyn deleted the patch-1 branch January 24, 2025 23:58
Ygnas pushed a commit to Ygnas/kuberay that referenced this pull request Mar 20, 2025
* Update swagger-initializer.js

* update docs
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 this pull request may close these issues.

[Bug] kuberay/apiserver deployment via helm doesn't respect https serving for swagger-ui

4 participants