Skip to content
Snippets Groups Projects
Commit bf9bfbc4 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

Merge branch 'swagger' into 'master'

Swagger

See merge request ghsc/nshmp/nshmp-netcdf!25
parents ae4ad1e0 c0d70f38
No related branches found
No related tags found
1 merge request!25Swagger
Pipeline #10609 passed
<!doctype html>
<head>
<title>Static Data Swagger Docs</title>
<meta charset="utf8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!DOCTYPE html>
<html lang="en">
<head>
<title>NSHMP WS Services</title>
<meta charset="UTF-8" />
<link
rel="icon"
type="image/png"
href="https://unpkg.com/swagger-ui-dist/favicon-32x32.png"
sizes="32x32"
/>
<link
rel="icon"
type="image/png"
href="https://unpkg.com/swagger-ui-dist/favicon-16x16.png"
sizes="16x16"
/>
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"></script>
<link
rel="stylesheet"
type="text/css"
href="https://unpkg.com/swagger-ui-dist/swagger-ui.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://unpkg.com/swagger-ui-themes@3.0.0/themes/3.x/theme-material.css"
/>
</head>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"/>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
<script>
let pathname = window.location.pathname;
pathname = pathname == "/" ? "" : pathname;
SwaggerUIBundle({
url: `${pathname}/swagger/netcdf-services.yml`,
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis
]
});
</script>
</body>
<body>
<div id="swagger-ui"></div>
<script src="index.js"></script>
</body>
</html>
window.onload = function() {
const extract = function(v) {
return decodeURIComponent(
v.replace(
/(?:(?:^|.*;\s*)contextPath\s*\=\s*([^;]*).*$)|^.*$/,
"$1"
)
);
},
cookie = extract(document.cookie),
contextPath = cookie === "" ? extract(window.location.search.substring(1)) : cookie,
f = contextPath === "" ? undefined : function(system) {
return {
statePlugins: {
spec: {
wrapActions: {
updateJsonSpec: (oriAction, system) => (...args) => {
let [spec] = args;
if (spec && spec.paths) {
const newPaths = {};
Object.entries(spec.paths)
.forEach(([path, value]) => (newPaths[contextPath + path] = value));
spec.paths = newPaths;
}
oriAction(...args);
}
}
}
}
};
},
ui = SwaggerUIBundle({
url: contextPath + "/swagger/netcdf-services.yml",
dom_id: "#swagger-ui",
tagsSorter: 'alpha',
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
plugins: [SwaggerUIBundle.plugins.DownloadUrl, f],
validatorUrl: null,
deepLinking: true
});
window.ui = ui;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment