added check for schema

This commit is contained in:
Tony Tam
2014-10-02 15:29:26 -07:00
parent 5823358e73
commit 4d2ad25a10
6 changed files with 67 additions and 17 deletions

4
dist/swagger-ui.js vendored
View File

@@ -1755,7 +1755,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
type = param.type || param.dataType;
if (typeof type === 'undefined') {
schema = param.schema;
if (schema['$ref']) {
if (schema && schema['$ref']) {
ref = schema['$ref'];
if (ref.indexOf('#/definitions/') === 0) {
type = ref.substring('#/definitions/'.length);
@@ -2209,7 +2209,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
type = this.model.type || this.model.dataType;
if (typeof type === 'undefined') {
schema = this.model.schema;
if (schema['$ref']) {
if (schema && schema['$ref']) {
ref = schema['$ref'];
if (ref.indexOf('#/definitions/') === 0) {
type = ref.substring('#/definitions/'.length);