mirror of
https://github.com/sourcey/spectacle.git
synced 2024-07-07 09:46:30 +03:00
Fix rendering of remote file references
This commit is contained in:
parent
e297fb9f5c
commit
c78cf37606
12
Makefile
Normal file
12
Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
NAME := sourcey/spectacle
|
||||
VERSION := $$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
|
||||
build:
|
||||
docker build -t ${NAME}:latest -t ${NAME}:v${VERSION} .
|
||||
|
||||
push:
|
||||
@echo ${NAME}
|
||||
@docker push ${NAME}
|
||||
|
||||
login:
|
||||
@docker log -u ${DOCKER_USER} -p ${DOCKER_PASS}
|
|
@ -22,6 +22,7 @@ See a demo of Spectacle in action here: [http://cheesestore.github.io](http://ch
|
|||
* **OpenAPI/Swagger 2.0 support**: Support for the latest OpenAPI/Swagger specification.
|
||||
* **Highly configurable**: Easily configurable Handlebars templates and SCSS styles so you can add your own design and flavour without going bald. See [Custom Builds](#custom-builds)
|
||||
* **Markdown support**: Render markdown written in any of your API descriptions.
|
||||
* **Remote file references**: Support for swagger specs split across multiple files.
|
||||
* **Clean responsive design**: Responsive HTML5 and CSS3 layout built with [Foundation 6](http://foundation.zurb.com/sites.html) that looks great on all devices and screen sizes.
|
||||
* **Embed into your existing website**: An embedded option so that generate partial docs without a HTML `<body>` for convenient integration into your existing website.
|
||||
* **Live preview developer mode**: Development mode that starts a local HTTP server with a file watcher and live reload so you can preview live changes in your browser as you update your spec.
|
||||
|
@ -47,7 +48,7 @@ Your generated documentation will be located in the `public` directory by defaul
|
|||
|
||||
### Docker
|
||||
|
||||
A basic Docker script is included that allows Spectacle to be run from the inside, not outside. It's useful, for instance, in a Gitlab CI pipeline. Thanks @alexeiaguiar.
|
||||
[Docker](https://hub.docker.com/r/sourcey/spectacle/) images are included that allow Spectacle to be run from the inside. It's useful, for instance, in a Gitlab CI pipeline. Thanks @alexeiaguiar.
|
||||
|
||||
How to use it: `docker run -it sourcey/spectacle /bin/sh`
|
||||
|
||||
|
|
|
@ -5,29 +5,29 @@
|
|||
*/
|
||||
module.exports = function (value) {
|
||||
return dataType(value)
|
||||
};
|
||||
}
|
||||
|
||||
function dataType(value) {
|
||||
// console.log('dataType', value)
|
||||
if (!value) return null;
|
||||
if (!value) return null
|
||||
if (typeof value === 'string') {
|
||||
throw 'invalid value'
|
||||
}
|
||||
if (value['anyOf'] || value['allOf'] || value['oneOf']) {
|
||||
return '';
|
||||
return ''
|
||||
}
|
||||
if (!value.type) {
|
||||
return 'object';
|
||||
return 'object'
|
||||
}
|
||||
if (value.type === 'array') {
|
||||
if (!value.items) {
|
||||
return 'array';
|
||||
return 'array'
|
||||
}
|
||||
if (value.items.type) {
|
||||
return dataType(value.items) + '[]';
|
||||
return dataType(value.items) + '[]'
|
||||
} else {
|
||||
return 'object[]';
|
||||
return 'object[]'
|
||||
}
|
||||
}
|
||||
return value.type;
|
||||
return value.type
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@ var util = require('util')
|
|||
* @param {Handlebars} engine the current handlebars engine
|
||||
*/
|
||||
module.exports = function(range, options) {
|
||||
var hasMinimum = range.minimum || range.minimum === 0;
|
||||
var hasMaximum = range.maximum || range.maximum === 0;
|
||||
var hasMinimum = range.minimum || range.minimum === 0
|
||||
var hasMaximum = range.maximum || range.maximum === 0
|
||||
|
||||
if (!hasMinimum && !hasMaximum) {
|
||||
// There is no range
|
||||
return "";
|
||||
return ""
|
||||
}
|
||||
|
||||
if (hasMinimum && !hasMaximum) {
|
||||
|
@ -41,7 +41,7 @@ module.exports = function(range, options) {
|
|||
range.maximum)
|
||||
}
|
||||
|
||||
// var numberSet = "";
|
||||
// var numberSet = ""
|
||||
// if (range.type === "integer") {
|
||||
// numberSet = "\u2208 \u2124" // ELEMENT OF - DOUBLE-STRUCK CAPITAL Z
|
||||
// } else if (range.type === "number") {
|
||||
|
@ -67,4 +67,4 @@ module.exports = function(range, options) {
|
|||
// range.maximumExclusive ? "<" : "\u2264",
|
||||
// range.maximum)
|
||||
// }
|
||||
};
|
||||
}
|
||||
|
|
18
app/helpers/schemaReferenceHref.js
Normal file
18
app/helpers/schemaReferenceHref.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
var common = require('../lib/common')
|
||||
|
||||
/**
|
||||
* Build href links for local and remote references.
|
||||
* @param reference
|
||||
*/
|
||||
module.exports = function(reference, options) {
|
||||
if (reference.indexOf('#') === 0) {
|
||||
// local references
|
||||
return reference
|
||||
}
|
||||
else {
|
||||
// remote references
|
||||
var path = ' #definition-'
|
||||
path += require('./htmlId')(reference)
|
||||
return path
|
||||
}
|
||||
};
|
|
@ -126,7 +126,7 @@ var common = {
|
|||
var remoteRef = this.resolveSchemaReference(ref.$ref, root)
|
||||
if (remoteRef)
|
||||
return this.formatExampleProp(remoteRef, root, options)
|
||||
}
|
||||
}
|
||||
else if (ref.properties) { // && ref.type == 'object'
|
||||
var obj = {};
|
||||
Object.keys(ref.properties).forEach(function(k) {
|
||||
|
@ -155,7 +155,7 @@ var common = {
|
|||
return ref.type + (ref.format ? ' (' + ref.format + ')' : '')
|
||||
}
|
||||
|
||||
console.error('Cannot format example on property ', ref)
|
||||
console.error('Cannot format example on property ', ref, ref.$ref)
|
||||
},
|
||||
|
||||
printSchema: function(value) {
|
||||
|
@ -188,19 +188,18 @@ var common = {
|
|||
},
|
||||
|
||||
resolveSchemaReference: function(reference, json) {
|
||||
var hashParts
|
||||
|
||||
reference = reference.trim()
|
||||
if (reference.lastIndexOf('#', 0) < 0) {
|
||||
console.warn('Remote references not supported yet. Reference must start with "#" (but was ' + reference + ')')
|
||||
return {};
|
||||
if (reference.indexOf('#') === 0) {
|
||||
var hash = reference.split('#')[1]
|
||||
hashParts = hash.split('/')
|
||||
}
|
||||
var components = reference.split('#')
|
||||
var url = components[0];
|
||||
var hash = components[1];
|
||||
var hashParts = hash.split('/')
|
||||
// TODO : Download remote json from url if url not empty
|
||||
var current = json; //options.data.root
|
||||
// return current;
|
||||
// console.log('aaaaaaaaaaaaaaaaaa', hashParts)
|
||||
else {
|
||||
hashParts = [ 'definitions', reference ]
|
||||
}
|
||||
|
||||
var current = json;
|
||||
hashParts.forEach(function(hashPart) {
|
||||
// Traverse schema from root along the path
|
||||
if (hashPart.trim().length > 0) {
|
||||
|
|
|
@ -106,7 +106,8 @@ function replaceReference(cwd, top, obj, context) {
|
|||
if(contexts.definition(context)) {
|
||||
if(!top.definitions) { top.definitions = {}; }
|
||||
if(!top.definitions[external]) { top.definitions[external] = referenced; }
|
||||
Object.assign(obj, { "$ref": "#/definitions/"+external.replace("/", "%2F") })
|
||||
// Object.assign(obj, { "$ref": "#/definitions/"+external.replace("/", "%2F") })
|
||||
Object.assign(obj, { "$ref": external })
|
||||
}
|
||||
else if(contexts.path(context)) {
|
||||
Object.keys(referenced).forEach(function(method) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{{!Renders a reference to a subschema}}
|
||||
{{#if $ref}}
|
||||
<span class="{{#if type}}json-schema-ref-{{type}}{{/if}}">
|
||||
<a class="json-schema-ref" href="{{$ref}}">{{schemaSubschemaName $ref}}</a>
|
||||
<a class="json-schema-ref" href="{{schemaReferenceHref $ref}}">{{schemaSubschemaName $ref}}</a>
|
||||
</span>
|
||||
{{else if items.$ref}}
|
||||
<span class="{{#if type}}json-schema-ref-{{type}}{{/if}}">
|
||||
<a class="json-schema-ref" href="{{items.$ref}}">{{schemaSubschemaName items.$ref}}</a>
|
||||
<a class="json-schema-ref" href="{{schemaReferenceHref items.$ref}}">{{schemaSubschemaName items.$ref}}</a>
|
||||
</span>
|
||||
{{/if}}
|
||||
|
|
4036
package-lock.json
generated
Normal file
4036
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -61,7 +61,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"mocha": "^3.2.0",
|
||||
"grunt-contrib-jshint": "^1.1.0"
|
||||
"grunt-contrib-jshint": "^1.1.0",
|
||||
"mocha": "^3.5.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,9 +19,8 @@
|
|||
<div id="logo">
|
||||
<img src="images/cheese.png" title="Cheese Store" /> </div>
|
||||
<nav id="nav" role="navigation">
|
||||
<h5>API Reference</h5>
|
||||
<h5>Topics</h5>
|
||||
<a href="#introduction">Introduction</a>
|
||||
<!-- <h5>Security</h5> -->
|
||||
<a href="#authentication">Authentication</a>
|
||||
<h5>Operations</h5>
|
||||
<section>
|
||||
|
@ -113,10 +112,10 @@
|
|||
</button>
|
||||
<div class="example-box doc-content"></div>
|
||||
<article>
|
||||
<h1 class="doc-title">Cheese Store
|
||||
<span>API Reference</span>
|
||||
</h1>
|
||||
<div id="introduction" data-traverse-target="introduction">
|
||||
<h1 class="doc-title">Cheese Store
|
||||
<span>API Reference</span>
|
||||
</h1>
|
||||
<div class="doc-row">
|
||||
<div class="doc-copy">
|
||||
<p>Welcome to the sample Cheese Store API reference. This is a live example of how you can use
|
||||
|
@ -259,7 +258,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -320,7 +322,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -420,7 +425,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -549,26 +557,17 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">tags</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in query </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string[]</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Tags to filter by</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">format</div>
|
||||
<div class="prop-value">multiple parameters (<code>tags=aaa&tags=bbb</code>)</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string[]</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">query</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner"> Array values passed as multiple parameters: <code>?tags=aaa&tags=bbb</code> </div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -590,6 +589,17 @@
|
|||
<p>Successful operation</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">
|
||||
<span class="json-schema-ref-array">
|
||||
<a class="json-schema-ref" href="#/definitions/Cheese">Cheese</a>
|
||||
</span>
|
||||
</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">404 Not Found</div>
|
||||
|
@ -626,7 +636,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -705,23 +718,17 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">cheeseId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>ID of cheese to return</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -778,7 +785,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -856,61 +866,43 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">cheeseId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>ID of the cheese to be updated</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">name</div>
|
||||
<div class="prop-subtitle"> in formData </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Updated name of the cheese</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">formData</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">status</div>
|
||||
<div class="prop-subtitle"> in formData </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Updated status of the cheese</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">formData</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -1001,43 +993,31 @@
|
|||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">api_key</div>
|
||||
<div class="prop-subtitle"> in header </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p class="no-description">(no description)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">header</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">cheeseId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Cheese ID to delete</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -1136,26 +1116,17 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">status</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in query </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string[]</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Status values that need to be considered for filter</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">format</div>
|
||||
<div class="prop-value">multiple parameters (<code>status=aaa&status=bbb</code>)</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string[]</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">query</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner"> Array values passed as multiple parameters: <code>?status=aaa&status=bbb</code> </div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -1177,6 +1148,17 @@
|
|||
<p>Successful operation</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">
|
||||
<span class="json-schema-ref-array">
|
||||
<a class="json-schema-ref" href="#/definitions/Cheese">Cheese</a>
|
||||
</span>
|
||||
</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">404 Not Found</div>
|
||||
|
@ -1213,7 +1195,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -1285,61 +1270,43 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">cheeseId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>ID of cheese to update</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">additionalMetadata</div>
|
||||
<div class="prop-subtitle"> in formData </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Additional data to pass to server</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">formData</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">file</div>
|
||||
<div class="prop-subtitle"> in formData </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">file</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Image file to upload</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">file</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">formData</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -1382,7 +1349,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -1468,6 +1438,17 @@
|
|||
<p>Successful operation</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">
|
||||
<span class="json-schema-ref-array">
|
||||
<a class="json-schema-ref" href="#/definitions/Cheese">Cheese</a>
|
||||
</span>
|
||||
</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples">
|
||||
|
@ -1490,7 +1471,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
@ -1686,23 +1670,17 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">orderId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits">1 ≤ x ≤ 10</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>ID of cheese that needs to be fetched</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits">1 ≤ x ≤ 10</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -1808,23 +1786,17 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">orderId</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits">x ≥ 1</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>ID of the order that needs to be deleted</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">integer</span>
|
||||
<span class="json-property-format">(int64)</span>
|
||||
<span class="json-property-range" title="Value limits">x ≥ 1</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -2078,42 +2050,30 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">username</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in query </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>The username for login</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">query</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">password</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in query </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>The password for login in clear text</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">query</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -2131,6 +2091,13 @@
|
|||
<p>Successful operation</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-group">
|
||||
<div class="prop-name">
|
||||
<div class="prop-title">422 Unprocessable Entity</div>
|
||||
|
@ -2299,22 +2266,16 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">username</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>The username of the customer to be fetched.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -2438,22 +2399,16 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">username</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Username of the customer to update.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples">
|
||||
|
@ -2554,22 +2509,16 @@
|
|||
<div class="prop-name">
|
||||
<div class="prop-title">username</div>
|
||||
<span class="json-property-required"></span>
|
||||
<div class="prop-subtitle"> in path </div>
|
||||
<div class="prop-subtitle">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-value">
|
||||
<p>Username of the customer to delete.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">type</div>
|
||||
<div class="prop-value">
|
||||
<span class="json-property-type">string</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prop-row prop-inner">
|
||||
<div class="prop-name param-label">in</div>
|
||||
<div class="prop-value">path</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="doc-examples"></div>
|
||||
|
@ -2675,6 +2624,7 @@
|
|||
<span class="json-property-name">complete:</span>
|
||||
<span class="json-property-type">boolean</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
<span class="json-property-default-value" title="Default value">false</span>
|
||||
</dt>
|
||||
</dl>
|
||||
</section>
|
||||
|
@ -3009,7 +2959,7 @@
|
|||
<span class="json-property-name">tags:</span>
|
||||
<span class="json-property-type">
|
||||
<span class="json-schema-ref-array">
|
||||
<a class="json-schema-ref" href="#/definitions/tag.yml#%2FTag">tag.yml#%2FTag</a>
|
||||
<a class="json-schema-ref" href=" #definition-tag.yml--Tag">tag.yml#/Tag</a>
|
||||
</span>
|
||||
</span>
|
||||
<span class="json-property-range" title="Value limits"></span>
|
||||
|
@ -3044,7 +2994,10 @@
|
|||
<span class="hljs-string">"https://wannabechef.com/gorgonzola.jpg"</span>
|
||||
],
|
||||
<span class="hljs-attr">"tags"</span>: [
|
||||
<span class="hljs-literal">null</span>
|
||||
{
|
||||
<span class="hljs-attr">"id"</span>: <span class="hljs-string">"integer (int64)"</span>,
|
||||
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"string"</span>
|
||||
}
|
||||
],
|
||||
<span class="hljs-attr">"status"</span>: <span class="hljs-string">"available"</span>
|
||||
}
|
||||
|
|
|
@ -1123,6 +1123,9 @@ Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-lic
|
|||
border-top: 1px solid #ddd; }
|
||||
#spectacle article .prop-row .prop-title {
|
||||
font-weight: bold; }
|
||||
#spectacle article .prop-row .prop-subtitle {
|
||||
font-weight: 400;
|
||||
font-size: 80%; }
|
||||
#spectacle article .prop-row .prop-name {
|
||||
text-align: right;
|
||||
padding-right: 0.85rem !important;
|
||||
|
|
2
public/stylesheets/spectacle.min.css
vendored
2
public/stylesheets/spectacle.min.css
vendored
File diff suppressed because one or more lines are too long
1088
test/fixtures/cheese.json
vendored
1088
test/fixtures/cheese.json
vendored
File diff suppressed because it is too large
Load Diff
2
test/fixtures/cheese.yml
vendored
2
test/fixtures/cheese.yml
vendored
|
@ -744,7 +744,7 @@ definitions:
|
|||
name: tag
|
||||
wrapped: true
|
||||
items:
|
||||
$ref: 'tag.yml#/Tag/'
|
||||
$ref: 'tag.yml#/Tag'
|
||||
status:
|
||||
type: string
|
||||
description: Cheese status in the store
|
||||
|
|
2
test/fixtures/tag.yml
vendored
2
test/fixtures/tag.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
# Extracted from cheese.json#/definitions/Tag
|
||||
# Extracted from cheese.yml#/definitions/Tag
|
||||
Tag:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
@ -82,7 +82,7 @@ describe("preprocessor referencing", function() {
|
|||
});
|
||||
|
||||
it("should update '$ref'", function() {
|
||||
response.schema.should.have.property("$ref", "#/definitions/fixtures%2FUser.yml");
|
||||
response.schema.should.have.property("$ref", "fixtures/User.yml");
|
||||
});
|
||||
|
||||
it("should include the definition globally", function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user