Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed from Swagger UI to RapiDoc #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Zerops REST API
# Zerops public REST API schema
Binary file added favicon.ico
Binary file not shown.
122 changes: 99 additions & 23 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,101 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Zerops REST API Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.11.0/swagger-ui.min.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.11.0/swagger-ui-bundle.js"></script>
<script>
window.onload = () => {
SwaggerUIBundle({
url: './openapi.yml',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
});
};
</script>
</body>
<head>
<meta charset="utf-8">
<title>Zerops REST API schema</title>

<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>

<style>
.header {
display: flex;
width:100%;

.logo {
height: 100%;
}
}

rapi-doc::part(section-logo),
rapi-doc::part(label-header-title) {
display: none;
}

rapi-doc::part(section-header) {
padding-left: 5px;
padding-right: 5px;
}

rapi-doc::part(section-main-content) {
padding-top: 15px;
padding-bottom: 15px;
}

@container (min-width: 768px) {
rapi-doc::part(section-header) {
padding-left: 25px;
padding-right: 25px;
}

rapi-doc::part(section-main-content) {
padding-top: 25px;
padding-bottom: 25px;
}
}
</style>
</head>
<body>
<rapi-doc id="rapi-doc"
spec-url="./openapi.yml"
server-url="https://api.app-prg1.zerops.io/"

render-style="view"

allow-spec-url-load="false"
allow-spec-file-load="false"

show-curl-before-try="true"
allow-server-selection="false"

font-size="large"
regular-font="Inter,BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Helvetica,Arial,sans-serif"
>
<div slot="header" class="header">
<a href="./">
<img src="./logo.svg" class="logo" alt="Zerops.io"/>
</a>
<div></div>
</div>
</rapi-doc>
<script type="text/javascript">
function changeTheme(themeName) {
let docEl = document.getElementById("rapi-doc");
if (themeName === 'dark') {
docEl.setAttribute('theme', 'dark');
docEl.setAttribute('primary-color', '#61dcd3');
docEl.setAttribute('bg-color', '#222');
docEl.setAttribute('text-color', '#ddd');
} else if (themeName === 'light') {
docEl.setAttribute('theme', 'light');
docEl.setAttribute('primary-color', '#00b1a3');
docEl.setAttribute('bg-color', '');
docEl.setAttribute('text-color', '#000');
}
}

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
changeTheme('dark');
} else {
changeTheme('light');
}

window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', ({matches}) => matches ? changeTheme('dark') : changeTheme('light'))
</script>
</body>
</html>
50 changes: 50 additions & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading