Merge commit 'ea0d242bfeac3ff1ba4af7ee3a70843c3d6f2fe9' into releases

This commit is contained in:
RedocBot 2016-08-21 08:59:11 +00:00 committed by travis@localhost
commit 4be06ea707
7 changed files with 45 additions and 7 deletions

17
CHANGELOG.md Normal file
View File

@ -0,0 +1,17 @@
# 1.1.0 (2016-08-12)
### Bug fixes
* Fix API description width on mobile
* Render valid JSON in samples (quoted object keys)
### Features/Improvements
* Add Tuple support (arrays with separate schema for each value) (#69)
* Add special representation for enum with one value (#70)
* Change `< * >` notation to `< anything >`
# 1.0.1 (2016-08-01)
### Bug fixes
* Use api host if schema host is undefined

View File

@ -9,10 +9,10 @@
</head> </head>
<body> <body>
<nav> <nav>
<header> ReDoc </header> <header> <a href="/"> ReDoc </a> </header>
<template is="dom-bind" id="specs"> <template is="dom-bind" id="specs">
<form id="schema-url-form" is="iron-form"> <form id="schema-url-form" is="iron-form">
<vaadin-combo-box-light id="spec-input" items="[[specs]]" attr-for-value="value" allow-custom-value> <vaadin-combo-box-light id="spec-input" items="[[specs]]" allow-custom-value>
<input placeholder="URL to a spec to try" id="schema-url-input" type="text" is="iron-input" value="https://rebilly.github.io/RebillyAPI/swagger.json"> <input placeholder="URL to a spec to try" id="schema-url-input" type="text" is="iron-input" value="https://rebilly.github.io/RebillyAPI/swagger.json">
</vaadin-combo-box-light> </vaadin-combo-box-light>
<button type="submit"> Explore </button> <button type="submit"> Explore </button>

View File

@ -109,6 +109,10 @@ nav iframe {
top: 0; top: 0;
} }
header a {
color: inherit;
text-decoration: none;
}
@media (min-width: 1000px) { @media (min-width: 1000px) {
nav header { nav header {
position: absolute; position: absolute;

View File

@ -48,10 +48,27 @@
'https://api.apis.guru/v2/specs/data2crm.com/1/swagger.yaml', 'https://api.apis.guru/v2/specs/data2crm.com/1/swagger.yaml',
'https://api.apis.guru/v2/specs/graphhopper.com/1.0/swagger.yaml' 'https://api.apis.guru/v2/specs/graphhopper.com/1.0/swagger.yaml'
]; ];
var $specInput = document.getElementById('spec-input'); var $specInput = document.getElementById('spec-input');
$specInput.addEventListener('value-changed', function(e) {
schemaUrlInput.value = e.detail.value; // $specInput.addEventListener('value-changed', function(e) {
// schemaUrlInput.value = e.detail.value;
// location.search = updateQueryStringParameter(location.search, 'url', schemaUrlInput.value);
// });
function selectItem() {
let value = this.innerText.trim();
schemaUrlInput.value = value;
location.search = updateQueryStringParameter(location.search, 'url', schemaUrlInput.value); location.search = updateQueryStringParameter(location.search, 'url', schemaUrlInput.value);
}
// for some reason events are not triggered so have to dirty fix this
$specInput.addEventListener('click', function(event) {
let $elems = document.querySelectorAll('.item.vaadin-combo-box-overlay');
$elems.forEach(function($el) {
$el.addEventListener('mousedown', selectItem);
$el.addEventListener('mousedown', selectItem);
});
}); });
}); });
//window.redocDebugMode = true; //window.redocDebugMode = true;

View File

@ -4,7 +4,7 @@
Download OpenAPI (fka Swagger) specification: Download OpenAPI (fka Swagger) specification:
<a class="openapi-button" target="_blank" attr.href='{{specUrl}}'> Download </a> <a class="openapi-button" target="_blank" attr.href='{{specUrl}}'> Download </a>
</p> </p>
<p *ngIf="info.description" [innerHtml]="info['x-redoc-html-description'] | safe"> </p> <p *ngIf="info.description" class="redoc-markdown-block" [innerHtml]="info['x-redoc-html-description'] | safe"> </p>
<p> <p>
<!-- TODO: create separate components for contact and license ? --> <!-- TODO: create separate components for contact and license ? -->
<span *ngIf="info.contact"> Contact: <span *ngIf="info.contact"> Contact:

View File

@ -5,7 +5,7 @@ declare var Prism: any;
const md = new Remarkable({ const md = new Remarkable({
html: true, html: true,
linkify: true, linkify: true,
breaks: false, breaks: true,
typographer: false, typographer: false,
highlight: (str, lang) => { highlight: (str, lang) => {
if (lang === 'json') lang = 'js'; if (lang === 'json') lang = 'js';

View File

@ -1,7 +1,7 @@
{ {
"name": "redoc", "name": "redoc",
"description": "Swagger-generated API Reference Documentation", "description": "Swagger-generated API Reference Documentation",
"version": "1.1.0", "version": "1.1.1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/Rebilly/ReDoc" "url": "git://github.com/Rebilly/ReDoc"