Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/rapidoc-min.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions docs/specs/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@
"lastName" : { "type": "string", "description": "Last Name" },
"jobTitle" : { "type": "string", "description": "Job title" },
"department": { "type": "string", "description": "Department name"},
"salary" : { "type": "number", "description": "Salary per annum"}
"salary" : { "type": "number", "description": "Salary per annum"},
"array" : {
"type": "array",
"items": {
"description": "A responsibility",
"properties": {
"type": { "type": "string", "description": "type of responsibility" }
}
}
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/utils/schema-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ export function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
});
obj = objWithAllProps;
} else if (schema.anyOf || schema.oneOf) {
obj['::description'] = schema.description ? schema.description : '';
// 1. First iterate the regular properties
if (schema.type === 'object' || schema.properties) {
obj['::description'] = schema.description ? schema.description : '';
obj['::type'] = 'object';
for (const key in schema.properties) {
if (schema.required && schema.required.includes(key)) {
Expand Down Expand Up @@ -382,7 +382,7 @@ export function schemaInObjectNotation(schema, obj, level = 0, suffix = '') {
obj['<any-key>'] = schemaInObjectNotation(schema.additionalProperties, {});
}
} else if (schema.items) { // If Array
obj['::description'] = schema.description ? schema.description : '';
obj['::description'] = schema.description ? schema.description : (schema.items.description ? `array&lt;${schema.items.description}&gt;` : '');
obj['::type'] = 'array';
obj['::props'] = schemaInObjectNotation(schema.items, {}, (level + 1));
obj['::title'] = schema.items.title ? schema.items.title : '';
Expand Down