Merge pull request #1512 from channelgrabber/issue-1423

Issue #1423: $ref schema objects in Responses Definitions Object don't seem to be displayed correctly
This commit is contained in:
Tony Tam
2015-08-06 17:15:32 -07:00

View File

@@ -139,8 +139,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
schemaObj = this.model.responses[code].schema;
if (schemaObj && schemaObj.$ref) {
schema = schemaObj.$ref;
if (schema.indexOf('#/definitions/') === 0) {
schema = schema.substring('#/definitions/'.length);
if (schema.indexOf('#/definitions/') !== -1) {
schema = schema.replace(/^.*#\/definitions\//, '');
}
}
this.model.responseMessages.push({