Guest User

Untitled

a guest
May 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. window.onload = function() {
  2. fetch('./swagger.json')
  3. .then(function(response) {
  4. response.json()
  5. .then(function(json) {
  6. json.schemes[0] = window.location.protocol.slice(0, -1)
  7. json.host = window.location.host
  8.  
  9. const ui = SwaggerUIBundle({
  10. spec: json,
  11. dom_id: '#swagger-ui',
  12. deepLinking: true,
  13. presets: [
  14. SwaggerUIBundle.presets.apis
  15. ],
  16. plugins: [
  17. SwaggerUIBundle.plugins.DownloadUrl
  18. ]
  19. })
  20.  
  21. window.ui = ui
  22. })
  23. })
  24. }
Add Comment
Please, Sign In to add comment