[Core, HTML2] Rendered docs are incomplete (#7510)

Co-authored-by: Malachi Jones <malachi.jones@metaswitch.com>
This commit is contained in:
Jim Schubert 2020-09-25 09:07:18 -04:00 committed by GitHub
parent f608803a40
commit cb4b03fcf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 724 additions and 599 deletions

View File

@ -103,29 +103,34 @@
});
function findNode(id, currentNode) {
return (Object.keys(currentNode)[0] === id) ? currentNode : findNodeInChildren(id, currentNode);
}
var currentChild,
result;
function findNodeInChildren(id, currentNode) {
for (let prop in currentNode) {
if (currentNode.hasOwnProperty(prop)) {
let currentChild = currentNode[prop];
if (id === prop) {
return currentChild;
} else {
// Search in the current child
if (typeof (currentChild) === 'object') {
let result = findNode(id, currentChild);
if (result !== false) {
return result;
if ( Object.keys(currentNode)[0] == id) {
return currentNode;
} else {
// Use a for loop instead of forEach to avoid nested functions
// Otherwise "return" will not work properly
for(var propt in currentNode){
if (currentNode.hasOwnProperty(propt)) {
currentChild = currentNode[propt]
if (id == propt) {
return currentChild;
} else {
// Search in the current child
if (typeof(currentChild) === 'object') {
result = findNode(id, currentChild);
if (result != false) {
return result;
}
}
}
}
}
// The node has not been found and we have no more options
return false;
}
return false;
}
</script>
<style type="text/css">
{{>fonts}}
@ -447,7 +452,7 @@
var schemaWrapper = {{{jsonSchema}}};
var schema = findNode('schema',schemaWrapper).schema;
if (!schema) {
schema = schemaWrapper.schema;
schema = schemaWrapper.schema;
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);

View File

@ -4,9 +4,10 @@
<script>
$(document).ready(function() {
var schemaWrapper = {{{jsonSchema}}};
var schema = findNode('schema', schemaWrapper).schema;
var schema = findNode('schema',schemaWrapper).schema;
if (!schema) {
schema = schemaWrapper.schema;
schema = schemaWrapper.schema;
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);

View File

@ -0,0 +1 @@
index.html

View File

@ -1 +1 @@
3.0.0-SNAPSHOT
5.0.0-SNAPSHOT

View File

@ -189,8 +189,8 @@ font-style: italic;
<li>in schema (model) member descriptions</li>
</ol>
</div>
<div class="app-desc">More information: <a href="https://helloreverb.com">https://helloreverb.com</a></div>
<div class="app-desc">Contact Info: <a href="hello@helloreverb.com">hello@helloreverb.com</a></div>
<div class="app-desc">More information: <a href="https://openapi-generator.tech">https://openapi-generator.tech</a></div>
<div class="app-desc">Contact Info: <a href="team@openapitools.org">team@openapitools.org</a></div>
<div class="app-desc">Version: 0.1.0</div>
<div class="app-desc">BasePath:/v1</div>
<div class="license-info">All rights reserved</div>
@ -226,7 +226,7 @@ font-style: italic;
<div class="field-items">
<div class="param">seed (required)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; A random number <em>seed</em>. </div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; A random number <em>seed</em>. default: null </div>
</div> <!-- field-items -->
@ -242,8 +242,8 @@ font-style: italic;
<div class="example-data-content-type">Content-Type: */*</div>
<pre class="example"><code>{
"sequence" : 1,
"seed" : 6.02745618307040320615897144307382404804229736328125,
"value" : 0.80082819046101150206595775671303272247314453125
"seed" : 6.027456183070403,
"value" : 0.8008281904610115
}</code></pre>
<h3 class="field-label">Produces</h3>

View File

@ -0,0 +1 @@
index.html

View File

@ -190,7 +190,6 @@ font-style: italic;
<h2>Access</h2>
<ol>
<li>APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true</li>
<li>APIKey KeyParamName:AUTH_KEY KeyInQuery:false KeyInHeader:false</li>
<li>OAuth AuthorizationUrl:http://petstore.swagger.io/api/oauth/dialogTokenUrl:</li>
</ol>

View File

@ -0,0 +1 @@
index.html

File diff suppressed because it is too large Load Diff