Skip to content

Allow links to be opened from Swagger UI documentations

Dheeraj Joshi requested to merge djadmin-allow-swagger-ui-links into master

What does this MR do and why?

This MR relaxes the sandbox restrictions for Swagger UI to make the links openable. We found couple of instances where links are present in the specification documents, and it'd be fine to allow them to be opened.

This was fixed by adding the allow-popups to the iFrame sandbox attribute:

Allows popups (like from window.open, target="_blank", showModalDialog). If this keyword is not used, that functionality will silently fail.

Screenshots or screen recordings

The links are currently blocked with the issue:

console error image

No browser error after this change

How to set up and validate locally

  1. Create a newopenapi.yml file (example)
  2. Add an external link to another website
  3. The link should be openable now.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports