Skip to content

Commit

Permalink
fixed a bug to display contact information and terms
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Aug 30, 2019
1 parent 9e1de5f commit ec63014
Show file tree
Hide file tree
Showing 19 changed files with 1,023 additions and 595 deletions.
27 changes: 27 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>RapiDoc</title>
</head>

<body>
<!--
Some sample spec to try
https://api.apis.guru/v2/specs/stripe.com/2019-02-19/swagger.json
https://api.apis.guru/v2/specs/github.com/v3/swagger.json
https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
https://petstore.swagger.io/v2/swagger.json
https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
-->

<rapi-doc
spec-url="./examples/specs/petstore.json"
layout="row"
>
</rapi-doc>
<script type="text/javascript" src="rapidoc-min.js"></script></body>

</html>
Binary file added dist/index.html.gz
Binary file not shown.
168 changes: 168 additions & 0 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

Binary file added dist/rapidoc-min.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/rapidoc-min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/rapidoc-min.js.map.gz
Binary file not shown.
Binary file added dist/rapidoc-regular.woff2
Binary file not shown.
Binary file added dist/rapidoc-semi-bold.woff2
Binary file not shown.
64 changes: 64 additions & 0 deletions dist/report.html

Large diffs are not rendered by default.

Binary file added dist/roboto-mono-bold.woff2
Binary file not shown.
Binary file added dist/roboto-mono-regular.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/example1.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
</style>
</head>
<body>
<rapi-doc spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json" style="min-width:460px"> </rapi-doc>
<rapi-doc spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json" style="min-width:460px" show-info="true"> </rapi-doc>
</body>
</html>
42 changes: 14 additions & 28 deletions docs/rapidoc-min.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rapidoc",
"version": "5.0.5",
"version": "5.0.6",
"description": "RapiDoc - Open API spec viewer with built in console",
"author": "Mrinmoy Majumdar <[email protected]>",
"repository": {
Expand All @@ -26,7 +26,7 @@
"module": "rapidoc.js",
"dependencies": {
"json-refs": "^3.0.13",
"lit-element": "2.2.0",
"lit-element": "2.2.1",
"lit-html": "1.0.0",
"marked": "^0.7.0",
"swagger2openapi": "^4.0.2"
Expand All @@ -36,23 +36,23 @@
"serve": "webpack-dev-server --mode=development"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"babel-loader": "^8.0.6",
"babel-plugin-template-html-minifier": "^3.0.0",
"clean-webpack-plugin": "^2.0.2",
"compression-webpack-plugin": "^2.0.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"babel-plugin-template-html-minifier": "^3.1.0",
"clean-webpack-plugin": "^3.0.0",
"compression-webpack-plugin": "^3.0.0",
"css-loader": "^3.2.0",
"file-loader": "^4.2.0",
"filemanager-webpack-plugin": "^2.0.5",
"html-webpack-plugin": "^3.2.0",
"inspectpack": "^4.2.1",
"inspectpack": "^4.2.2",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.35.3",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.5",
"webpack-dev-server": "^3.4.1"
"sass-loader": "^8.0.0",
"style-loader": "^1.0.0",
"webpack": "^4.39.3",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-cli": "^3.3.7",
"webpack-dev-server": "^3.8.0"
}
}
2 changes: 1 addition & 1 deletion src/components/api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export default class ApiRequest extends LitElement {
me.curlSyntax = `${curl} ${curlHeaders} ${curlData} ${curlForm}`;
try {
tryBtnEl.disabled = true;
await wait(1000);
// await wait(1000);
const resp = await fetch(fetchUrl,fetchOptions);
tryBtnEl.disabled = false;
me.responseStatus = resp.ok ? 'success':'error';
Expand Down
30 changes: 29 additions & 1 deletion src/rapidoc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LitElement, html, css} from 'lit-element';
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
import MLogo from '@/components/m-logo';
import EndPoints from '@/components/end-points';
import SecuritySchemes from '@/components/security-schemes';
Expand Down Expand Up @@ -212,6 +212,34 @@ export default class RapiDoc extends LitElement {
${this.resolvedSpec.info.description?html`
${unsafeHTML(`<div class='m-markdown regular-font'>${marked(this.resolvedSpec.info.description)}</div>`)}
`:``}
${this.resolvedSpec.info.termsOfService?html`
${unsafeHTML(`<div class='tiny-title' style="margin-top:8px"> Terms: </div> <span class='m-markdown regular-font'>${marked(this.resolvedSpec.info.termsOfService)}</span>`)}
`:``}
${this.resolvedSpec.info.contact?html`
<div style="font-size:13px; margin-top:8px; line-height: 18px;">
${this.resolvedSpec.info.contact.email?html`
<div>
<span class='tiny-title' style="display:inline-block; width:50px"> Email: </span>
<span class='regular-font'> ${this.resolvedSpec.info.contact.email}</span>
</div>
`:``}
${this.resolvedSpec.info.contact.name?html`
<div>
<span class='tiny-title' style="display:inline-block; width:50px"> Name: </span>
<span class='regular-font'> ${this.resolvedSpec.info.contact.name}</span>
</div>
`:``}
${this.resolvedSpec.info.contact.url?html`
<div>
<span class='tiny-title' style="display:inline-block; width:50px"> URL: </span>
<span class='regular-font'> ${this.resolvedSpec.info.contact.url}</span>
</div>
`:``}
</div>
`:``}
</div>`
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/font-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default html`
.mono-font{font-family:var(--font-mono);}
.title{font-size:32px;}
.sub-title{font-size: 18px;}
.tiny-title {font-size:13px; font-weight:bold}
.regular-font-size{ font-size:var(--regular-font-size);}
.small-font-size{ font-size:var(--small-font-size);}
h1{ font-family:var(--font-regular); font-size:20px; letter-spacing:normal; }
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const webpack = require('webpack');
const CompressionPlugin = require('compression-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { DuplicatesPlugin } = require("inspectpack/plugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');

const path = require('path');
const commonPlugins = [
Expand Down
Loading

0 comments on commit ec63014

Please sign in to comment.