This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7dd53e8af5 Fix blank Redoc page after the upgrade to Redoc 3
7dd53e8af5 is described below
commit 7dd53e8af5a929a64cac0599f6a57e68f3e81f09
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Mon Oct 19 19:03:25 2026 +0200
Fix blank Redoc page after the upgrade to Redoc 3
Redoc 3 is distributed as an ES module and no longer defines a global
Redoc object, so loading redoc.standalone.js with a classic script tag
failed and the page stayed empty. Load it as a module and call the
exported init function instead.
Also disable the usage telemetry that Redoc 3 sends to Redocly by
default.
Co-Authored-By: Claude Opus 5.5
---
framework/rest-api/webapp/docs/redoc.html | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/framework/rest-api/webapp/docs/redoc.html
b/framework/rest-api/webapp/docs/redoc.html
index 4eeca2173f..eebd20634b 100644
--- a/framework/rest-api/webapp/docs/redoc.html
+++ b/framework/rest-api/webapp/docs/redoc.html
@@ -36,17 +36,17 @@ under the License.
</head>
<body>
<redoc></redoc>
- <script src="/docs/redoc.standalone.js"> </script>
- <script>
- if (!window.location.origin) {
- window.location.origin = window.location.protocol + "//" +
window.location.hostname + (window.location.port ? ':' + window.location.port :
'');
- }
+ <script type="module">
+ // Redoc 3 is distributed as an ES module and no longer defines a global
Redoc object
+ import { init } from "/docs/redoc.standalone.js";
const pathSegments = window.location.pathname.split('/').filter(Boolean);
const apiName = pathSegments.length >= 3 ?
pathSegments[pathSegments.length - 2] : null;
const apiGroupPath = apiName ? encodeURIComponent(apiName) + "/" :
"api/";
- Redoc.init(window.location.origin + "/rest/" + apiGroupPath +
"openapi.json");
+ // Redoc 3 sends usage telemetry to Redocly by default
+ init(window.location.origin + "/rest/" + apiGroupPath + "openapi.json",
{ disableTelemetry: true },
+ document.querySelector("redoc"));
</script>
</body>
</html>