Created
May 9, 2021 01:53
-
-
Save msrd0/136714f9ca0a161e359cf35854b78a53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"/> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700|Source+Code+Pro:300,400,700&display=swap"/> | |
</head> | |
<body style="margin:0"> | |
<div id="redoc"></div> | |
<script> | |
const SPEC = "%7B%22openapi%22:%223.0.2%22,%22info%22:%7B%22title%22:%22Example%20OpenAPI%20Specification%22,%22version%22:%220.0.0%22%7D,%22servers%22:%5B%7B%22url%22:%22http://127.0.0.1:7878%22%7D%5D,%22paths%22:%7B%22//ints%22:%7B%22post%22:%7B%22operationId%22:%22create_ints%22,%22requestBody%22:%7B%22content%22:%7B%22application/json%22:%7B%22schema%22:%7B%22$ref%22:%22%23/components/schemas/LotsOfInts%22%7D%7D%7D,%22required%22:true%7D,%22responses%22:%7B%22200%22:%7B%22description%22:%22OK%22,%22content%22:%7B%22application/json%22:%7B%22schema%22:%7B%22$ref%22:%22%23/components/schemas/LotsOfInts%22%7D%7D%7D%7D%7D%7D%7D,%22//strings%22:%7B%22post%22:%7B%22operationId%22:%22create_strings%22,%22requestBody%22:%7B%22content%22:%7B%22application/json%22:%7B%22schema%22:%7B%22$ref%22:%22%23/components/schemas/LotsOfStrings%22%7D%7D%7D,%22required%22:true%7D,%22responses%22:%7B%22200%22:%7B%22description%22:%22OK%22,%22content%22:%7B%22application/json%22:%7B%22schema%22:%7B%22$ref%22:%22%23/components/schemas/LotsOfStrings%22%7D%7D%7D%7D%7D%7D%7D%7D,%22components%22:%7B%22schemas%22:%7B%22LotsOfInts%22:%7B%22title%22:%22LotsOfInts%22,%22description%22:%22A%20lot%20of%20integers%20of%20different%20sizes%22,%22type%22:%22object%22,%22properties%22:%7B%22a%22:%7B%22description%22:%22a%20default%20size%20integer%22,%22type%22:%22integer%22%7D,%22b%22:%7B%22description%22:%22an%208%20bit%20integer%22,%22type%22:%22integer%22,%22format%22:%22int8%22%7D,%22c%22:%7B%22description%22:%22a%2016%20bit%20integer%22,%22type%22:%22integer%22,%22format%22:%22int16%22%7D,%22d%22:%7B%22description%22:%22a%2032%20bit%20integer%22,%22type%22:%22integer%22,%22format%22:%22int32%22%7D,%22e%22:%7B%22description%22:%22a%2064%20bit%20integer%22,%22type%22:%22integer%22,%22format%22:%22int64%22%7D,%22f%22:%7B%22description%22:%22a%20128%20bit%20integer%22,%22type%22:%22integer%22,%22format%22:%22int128%22%7D,%22g%22:%7B%22description%22:%22a%20default%20size%20unsigned%20integer%22,%22type%22:%22integer%22,%22minimum%22:0%7D,%22h%22:%7B%22description%22:%22an%208%20bit%20unsigned%20integer%22,%22type%22:%22integer%22,%22format%22:%22int8%22,%22minimum%22:0%7D,%22i%22:%7B%22description%22:%22a%2016%20bit%20unsigned%20integer%22,%22type%22:%22integer%22,%22format%22:%22int16%22,%22minimum%22:0%7D,%22j%22:%7B%22description%22:%22a%2032%20bit%20unsigned%20integer%22,%22type%22:%22integer%22,%22format%22:%22int32%22,%22minimum%22:0%7D,%22k%22:%7B%22description%22:%22a%2064%20bit%20unsigned%20integer%22,%22type%22:%22integer%22,%22format%22:%22int64%22,%22minimum%22:0%7D,%22l%22:%7B%22description%22:%22a%20128%20bit%20unsigned%20integer%22,%22type%22:%22integer%22,%22format%22:%22int128%22,%22minimum%22:0%7D%7D,%22required%22:%5B%22a%22,%22b%22,%22c%22,%22d%22,%22e%22,%22f%22,%22g%22,%22h%22,%22i%22,%22j%22,%22k%22,%22l%22%5D%7D,%22LotsOfStrings%22:%7B%22title%22:%22LotsOfStrings%22,%22description%22:%22A%20lot%20of%20strings%20with%20different%20formats.%22,%22type%22:%22object%22,%22properties%22:%7B%22str%22:%7B%22description%22:%22A%20normal%20string%22,%22type%22:%22string%22%7D,%22date%22:%7B%22description%22:%22A%20date%22,%22type%22:%22string%22,%22format%22:%22date%22%7D,%22datetime%22:%7B%22description%22:%22A%20datetime%22,%22type%22:%22string%22,%22format%22:%22date-time%22%7D,%22uuid%22:%7B%22description%22:%22A%20uuid%22,%22type%22:%22string%22,%22format%22:%22uuid%22%7D%7D,%22required%22:%5B%22str%22,%22date%22,%22datetime%22,%22uuid%22%5D%7D%7D%7D%7D"; | |
window.onload = function() { | |
const REDOC_URL = "https://cdn.jsdelivr.net/npm/redoc@2.0.0-rc.53/bundles/redoc.standalone.js"; | |
const REDOC_SRI = "FAbK/5MuJ1fv6AUK+Cjrnnx8lj5Ym7TJmxv7Lli/o44Dlm5z/bF5UDQin+INTbR77xU2r5+gm7OKPG1blrBCZA=="; | |
const cb = function() { | |
const spec = JSON.parse(decodeURI(SPEC)); | |
Redoc.init(spec, { | |
theme: { | |
typography: { | |
fontFamily: '"Open Sans",sans-serif', | |
fontWeightBold: '700', | |
headings: { | |
fontFamily: '"Open Sans",sans-serif', | |
}, | |
code: { | |
fontFamily: '"Source Code Pro",monospace' | |
} | |
}, | |
menu: { | |
backgroundColor: '#262a2b', | |
textColor: '#fafafa' | |
} | |
} | |
}, document.getElementById('redoc')); | |
}; | |
const s = document.createElement('script'); | |
s.setAttribute('src', REDOC_URL); | |
s.setAttribute('integrity', 'sha512-' + REDOC_SRI); | |
s.setAttribute('crossorigin', 'anonymous'); | |
s.onload = cb; | |
document.head.appendChild(s); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment