Browse Source

Add OpenAPI HTTP spec (#1804)

tags/v0.50
Richard Willis 8 months ago
parent
commit
62b9b1f15f
No account linked to committer's email address
4 changed files with 2586 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +23
    -0
      api/docs/generate-docs.sh
  3. +31
    -0
      api/docs/template.hbs
  4. +2531
    -0
      api/mailinabox.yml

+ 1
- 0
.gitignore View File

@@ -5,3 +5,4 @@ tools/__pycache__/
externals/
.env
.vagrant
api/docs/api-docs.html

+ 23
- 0
api/docs/generate-docs.sh View File

@@ -0,0 +1,23 @@
#!/usr/bin/env sh

# Requirements:
# - Node.js
# - redoc-cli (`npm install redoc-cli -g`)

redoc-cli bundle ../mailinabox.yml \
-t template.hbs \
-o api-docs.html \
--templateOptions.metaDescription="Mail-in-a-Box HTTP API" \
--title="Mail-in-a-Box HTTP API" \
--options.expandSingleSchemaField \
--options.hideSingleRequestSampleTab \
--options.jsonSampleExpandLevel=10 \
--options.hideDownloadButton \
--options.theme.logo.maxHeight=180px \
--options.theme.logo.maxWidth=180px \
--options.theme.colors.primary.main="#C52" \
--options.theme.typography.fontSize=16px \
--options.theme.typography.fontFamily="Raleway, sans-serif" \
--options.theme.typography.headings.fontFamily="Ubuntu, Arial, sans-serif" \
--options.theme.typography.code.fontSize=15px \
--options.theme.typography.code.fontFamily='"Source Code Pro", monospace'

+ 31
- 0
api/docs/template.hbs View File

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf8" />
<title>{{title}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{templateOptions.metaDescription}}" />
<link rel="icon" type="image/png" href="https://mailinabox.email/static/logo_small.png">
<link rel="apple-touch-icon" type="image/png" href="https://mailinabox.email/static/logo_small.png">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500" rel="stylesheet" />
<style>
body {
margin: 0;
padding: 0;
}

h1 {
color: #000 !important;
}
</style>
{{{redocHead}}}
</head>

<body>
{{{redocHTML}}}
</body>

</html>

+ 2531
- 0
api/mailinabox.yml
File diff suppressed because it is too large
View File


Loading…
Cancel
Save