Added basePath to openApi file to enable 'Try Out' feature in UI
Signed-off-by: Matthias Koller <m.koller@peak-solution.de>
diff --git a/src/main/openapi/openApiFile.json b/src/main/openapi/openApiFile.json
index 897a764..6fe3c2d 100644
--- a/src/main/openapi/openApiFile.json
+++ b/src/main/openapi/openApiFile.json
@@ -13,6 +13,10 @@
"url" : "https://projects.eclipse.org/projects/technology.mdmbl"
}
},
+ "servers" : [{
+ "url": "/org.eclipse.mdm.nucleus/mdm",
+ "description": "openMDM 5 REST API"
+ }],
"externalDocs" : {
"description" : "Getting Started Guide",
"url" : "https://wiki.eclipse.org/images/e/e0/GettingStarted_mdmbl.pdf"
diff --git a/src/main/webapp/swagger.html b/src/main/webapp/swagger.html
index 8ea9f5f..fac1f9d 100644
--- a/src/main/webapp/swagger.html
+++ b/src/main/webapp/swagger.html
@@ -30,7 +30,7 @@
window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
- url: "openapi.json",
+ url: window.location.href.replace("swagger.html", "openapi.json"),
dom_id: '#swagger-ui',
deepLinking: true,
presets: [