Skip to content

Commit

Permalink
Release 4.0.0 - Added API search functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Mar 1, 2019
1 parent 66069a1 commit 2d6686e
Show file tree
Hide file tree
Showing 19 changed files with 1,481 additions and 1,446 deletions.
22 changes: 22 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"presets": [
[
"@babel/preset-env",
{ "targets": {"esmodules": true}}
]
],
"plugins": [
["template-html-minifier", {
"modules": {
"lit-html": ["html"],
"lit-element": [
"html",
{"name": "css", "encapsulation": "style"}
],
},
"htmlMinifier": {
"collapseWhitespace": true
}
}]
]
}
4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
>
</rapi-doc>
-->
<rapi-doc spec-url="https://api.apis.guru/v2/specs/azure.com/workloadmonitor-Microsoft.WorkloadMonitor/2018-08-31-preview/swagger.json"
<rapi-doc
spec-url="https://petstore.swagger.io/v2/swagger.json"
layout="row"
theme="light"
show-info="false"
>
</rapi-doc>
<script type="text/javascript" src="rapidoc-min.js"></script></body>
Expand Down
Binary file modified dist/index.html.gz
Binary file not shown.
781 changes: 180 additions & 601 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/rapidoc-min.js.map

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.map.gz
Binary file not shown.
63 changes: 52 additions & 11 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,13 @@ <h2> Attributes</h2>
<th style="text-align:left">Description </th>
<th class="default-col">Default</th>
</tr>

<tr>
<td class="mono-bold">spec-url </td>
<td class="gray">url of the OpenAPI spec to view </td>
<td>(empty)</td>
</tr>

<tr>
<td class="mono-bold">server</td>
<td class="gray">
Expand All @@ -190,26 +192,30 @@ <h2> Attributes</h2>
</td>
<td>(empty)</td>
</tr>

<tr>
<td class="mono-bold">show-authentication</td>
<td class="gray">
Authentication feature, allows the user to select one of the authentication mechanism thats available in the spec.
It can be http-basic, http-bearer or api-key.
If you dont want your users to go through the authentication process, instead want them to use a pre-generated api-key
then you may hide authentication section by setting this attribute to false
and provide the api-key details using various api-key-???? attributes.</td>
<td>true</td>
</tr>
<td class="mono-bold">allow-authentication</td>
<td class="gray">
Authentication feature, allows the user to select one of the authentication mechanism thats available in the spec.
It can be http-basic, http-bearer or api-key.
If you dont want your users to go through the authentication process, instead want them to use a pre-generated api-key
then you may hide authentication section by setting this attribute to false
and provide the api-key details using various api-key-???? attributes.</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">api-key-name</td>
<td class="gray">Name of the API key that will be send while trying out the APIs</td>
<td>(empty)</td>
</tr>

<tr>
<td class="mono-bold">api-key-value</td>
<td class="gray">Value of the API key that will be send while trying out the APIs</td>
<td>Authorization</td>
</tr>

<tr>
<td class="mono-bold">api-key-location</td>
<td class="gray">
Expand All @@ -218,14 +224,41 @@ <h2> Attributes</h2>
</td>
<td>header</td>
</tr>

<tr>
<td class="mono-bold">show-try</td>
<td class="mono-bold">allow-spec-url-load</td>
<td class="gray">
If set to 'false', user will not be able to load any spec url from the UI.
</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">allow-spec-file-load</td>
<td class="gray">
If set to 'false', user will not be able to load any spec file from the local drive.
This attribute is applicable only when the device width is more than 768px, else this feature is not available
</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">allow-search</td>
<td class="gray">
If set to 'false', user will not be able to search APIs.
</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">allow-try</td>
<td class="gray">
'TRY' feature allows you to make REST calls to the API server.
To disable this feature set it to false
</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">show-info</td>
<td class="gray">
Expand All @@ -236,52 +269,60 @@ <h2> Attributes</h2>
</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">show-header </td>
<td class="gray">show/hide the header.<br/>
If you dont want your user to open any other api spec, other than the current one, then set this attribute to false</td>
<td>true</td>
</tr>

<tr>
<td class="mono-bold">heading-text </td>
<td class="gray">Heading Text on top-left corner </td>
<td>(empty)</td>
</tr>

<tr>
<td class="mono-bold">header-color </td>
<td class="gray">Hex color code for the header's background</td>
<td>#444444</td>
</tr>

<tr>
<td class="mono-bold">primary-color</td>
<td class="gray">Hex color code on various controls such as buttons, tabs </td>
<td>#FF791A</td>
</tr>

<tr>
<td class="mono-bold">regular-font </td>
<td class="gray">Font Name(s) to be used for regular text </td>
<td>rapidoc, Helvetica, Arial</td>
</tr>

<tr>
<td class="mono-bold">mono-font </td>
<td class="gray">Font Name(s) to be used for monospaced text </td>
<td>Monaco, 'Andale Mono', 'Roboto Mono'</td>
</tr>

<tr>
<td class="mono-bold">theme </td>
<td class="gray">light, dark </td>
<td>light</td>
</tr>

<tr>
<td class="mono-bold"> layout </td>
<td class="gray">layout helps in placement of your request/response sections. The allowed values are 'row' or 'column'.
In column layout, request & response sections are placed one below the other,
In row layout request & response sections are placed side by side.
This attribute is applicable only when the device width is more than 768px.

</td>
<td>row</td>
</tr>

</table>
</div>

Expand Down
781 changes: 180 additions & 601 deletions docs/rapidoc-min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
>
</rapi-doc>
-->
<rapi-doc spec-url="https://api.apis.guru/v2/specs/azure.com/workloadmonitor-Microsoft.WorkloadMonitor/2018-08-31-preview/swagger.json"
<rapi-doc
spec-url="https://petstore.swagger.io/v2/swagger.json"
layout="row"
theme="light"
show-info="false"
>
</rapi-doc>
</body>
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rapidoc",
"version": "3.2.2",
"version": "4.0.0",
"description": "RapiDoc - Open API spec viewer with built in console",
"author": "Mrinmoy Majumdar <[email protected]>",
"repository": {
Expand Down Expand Up @@ -38,6 +38,10 @@
"serve": "webpack-dev-server --mode=development"
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"babel-loader": "^8.0.5",
"babel-plugin-template-html-minifier": "^2.2.1",
"clean-webpack-plugin": "^1.0.1",
"compression-webpack-plugin": "^2.0.0",
"css-loader": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class ApiRequest extends LitElement {
${this.requestBodyTemplate()}
${this.inputParametersTemplate('header')}
${this.inputParametersTemplate('cookie')}
${this.showTry==='false'?'':html`${this.apiCallTemplate()}`}
${this.allowTry==='false'?'':html`${this.apiCallTemplate()}`}
</div>
`
}
Expand Down Expand Up @@ -137,7 +137,7 @@ export default class ApiRequest extends LitElement {
responseHeaders: { type: String, attribute:false },
responseStatus : { type: String, attribute:false },
responseUrl : { type: String, attribute:false },
showTry : { type: String, attribute: 'show-try' },
allowTry : { type: String, attribute: 'allow-try' },

};
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/api-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export default class ApiResponse extends LitElement {
let mimeRespObj = this.responses[statusCode].content[mimeResp];
//Remove Circular references from Response schema
try {
mimeRespObj.schema = JSON.parse(JSON.stringify(mimeRespObj.schema, removeCircularReferences(0)));
//mimeRespObj.schema = JSON.parse(JSON.stringify(mimeRespObj.schema, removeCircularReferences(0)));
if (mimeRespObj.schema){
mimeRespObj.schema = JSON.parse(JSON.stringify(mimeRespObj.schema, removeCircularReferences(0)));
}
}
catch{
console.error("Unable to resolve circular refs in schema", mimeRespObj.schema);
Expand Down
Loading

0 comments on commit 2d6686e

Please sign in to comment.