-
+
diff --git a/lib/components/JsonSchema/json-schema.ts b/lib/components/JsonSchema/json-schema.ts
index 9a86196a..5dabbef9 100644
--- a/lib/components/JsonSchema/json-schema.ts
+++ b/lib/components/JsonSchema/json-schema.ts
@@ -20,6 +20,8 @@ export class JsonSchema extends BaseComponent {
activeDescendant:any = {};
hasDescendants: boolean = false;
_hasSubSchemas: boolean = false;
+ properties: any;
+ _isArray: boolean;
@Input() isArray: boolean;
@Input() final: boolean = false;
@Input() nestOdd: boolean;
@@ -80,17 +82,27 @@ export class JsonSchema extends BaseComponent {
if (!this.schema.isTrivial) {
SchemaHelper.preprocessProperties(this.schema, this.normPointer, {
- childFor: this.childFor,
- skipReadOnly: this.isRequestSchema
+ childFor: this.childFor
});
}
+ this.properties = this.schema._properties;
+ this._isArray = this.isArray || this.schema._isArray;
+ if (this.isRequestSchema) {
+ this.properties = this.properties && this.properties.filter(prop => !prop.readOnly);
+ }
+
this.initDescendants();
- this._hasSubSchemas = this.schema._properties && this.schema._properties.some(
- propSchema => propSchema.type === 'object' && propSchema._pointer);
+ this._hasSubSchemas = this.properties && this.properties.some(
+ propSchema => {
+ if (propSchema.type === 'array') {
+ propSchema = propSchema.items;
+ }
+ return (propSchema && propSchema.type === 'object' && propSchema._pointer);
+ });
}
- trackByName(index: number, item: any): string {
- return item['name'];
+ trackByIdx(index: number, item: any): number {
+ return index;
}
}
diff --git a/lib/components/MethodsList/methods-list.html b/lib/components/MethodsList/methods-list.html
index c2217caa..6d867af0 100644
--- a/lib/components/MethodsList/methods-list.html
+++ b/lib/components/MethodsList/methods-list.html
@@ -4,7 +4,7 @@
-
diff --git a/lib/components/MethodsList/methods-list.ts b/lib/components/MethodsList/methods-list.ts
index 62b75763..a919cdfe 100644
--- a/lib/components/MethodsList/methods-list.ts
+++ b/lib/components/MethodsList/methods-list.ts
@@ -42,4 +42,8 @@ export class MethodsList extends BaseComponent {
this.data.tags = tags;
// TODO: check $ref field
}
+
+ trackByPointer(idx, el) {
+ return el.pointer;
+ }
}
diff --git a/lib/components/ResponsesList/responses-list.html b/lib/components/ResponsesList/responses-list.html
index b39e7190..61394b13 100644
--- a/lib/components/ResponsesList/responses-list.html
+++ b/lib/components/ResponsesList/responses-list.html
@@ -1,5 +1,5 @@
-
|