Skip to content

Commit 0fd38f2

Browse files
committed
merge all of schemas in allOf of a schema before passing to form builder
1 parent b1b5170 commit 0fd38f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/directives/tryoperation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ SwaggerEditor.controller('TryOperation', function($scope, formdataFilter,
213213
.properties[paramSchema.name] = paramSchema;
214214
});
215215
}
216-
217216
return schema;
218217
}
219218

@@ -301,6 +300,13 @@ SwaggerEditor.controller('TryOperation', function($scope, formdataFilter,
301300
schema.title = schema.name;
302301
}
303302

303+
// if a schema has allOf it means that the schema is the result of mergin all
304+
// schemas in it's allOf array.
305+
if (schema.allOf) {
306+
schema = _.assign.apply(null, [schema].concat(schema.allOf));
307+
delete schema.allOf;
308+
}
309+
304310
// if schema is missing the "type" property fill it in based on available
305311
// properties
306312
if (!schema.type) {

0 commit comments

Comments
 (0)