minor code improvement

This commit is contained in:
Roman Hotsiy 2015-11-29 17:06:08 +02:00
parent 2eabd2b333
commit 3b5cd1068b

View File

@ -2,6 +2,7 @@
import {RedocComponent, BaseComponent} from '../base'; import {RedocComponent, BaseComponent} from '../base';
import {ElementRef} from 'angular2/angular2'; import {ElementRef} from 'angular2/angular2';
import JsonPointer from '../../utils/JsonPointer';
@RedocComponent({ @RedocComponent({
selector: 'json-schema', selector: 'json-schema',
@ -83,7 +84,7 @@ export default class JsonSchema extends BaseComponent {
let itemFormat = propData.items.format; let itemFormat = propData.items.format;
if (itemType === 'object') { if (itemType === 'object') {
itemType = propData.items.title || 'object'; itemType = propData.items.title || 'object';
propData._pointer = propData.items._pointer || this.pointer + '/properties/' + prop + '/items'; propData._pointer = propData.items._pointer || JsonPointer.join(this.pointer, ['properties', prop, 'items']);
} }
propData._displayType = `array of ${itemType}`; propData._displayType = `array of ${itemType}`;
propData.format = itemFormat; propData.format = itemFormat;