I am using Redoc standalone with our API server. After redoc.standalone.js
is loaded, redoc
tries to fetch schema.yaml
from the API server. However, our server needs an Authorization
header with token, which Redoc
does not include by default. I am looking for a solution to either download and save the schema file locally or add the Authorization
header as a default header for all requests sent from the page. Is there another way to read schema.yaml
locally by Redoc
without making a request to the private API server? Below is the current HTML code I am using with Redoc:
<!DOCTYPE html>
<html>
<head>
<title>Example API</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='https://api.example.com/schema.yaml'></redoc>
<script src="redoc.standalone.js"></script>
</body>
</html>