|
124 | 124 | return { |
125 | 125 | restrict: 'E', |
126 | 126 | templateUrl: 'directives/documentation.tpl.html', |
127 | | - replace: true, |
128 | 127 | controller: ['$scope', function($scope) { |
129 | 128 | var defaultSchemaKey = Object.keys($scope.securitySchemes).sort()[0]; |
130 | 129 | var defaultSchema = $scope.securitySchemes[defaultSchemaKey]; |
|
149 | 148 | } |
150 | 149 |
|
151 | 150 | function copyToCodesIfNotPresent(codes, schemaCodes) { |
152 | | - Object.keys(schemaCodes).forEach(function (code) { |
153 | | - if (schemaCodes.hasOwnProperty(code) && !codes.hasOwnProperty(code)) { |
154 | | - codes[code] = schemaCodes[code]; |
155 | | - } |
156 | | - }); |
| 151 | + if (Array.isArray(schemaCodes)) { |
| 152 | + schemaCodes.forEach(function (response) { |
| 153 | + if (!codes.hasOwnProperty(response.code)) { |
| 154 | + codes[response.code] = response.code; |
| 155 | + } |
| 156 | + }); |
| 157 | + } else { |
| 158 | + Object.keys(schemaCodes).forEach(function (code) { |
| 159 | + if (schemaCodes.hasOwnProperty(code) && !codes.hasOwnProperty(code)) { |
| 160 | + codes[code] = schemaCodes[code]; |
| 161 | + } |
| 162 | + }); |
| 163 | + } |
157 | 164 | } |
158 | 165 | $scope.fullResponses = mergeResponseCodes($scope.methodInfo.responses || {}, $scope.methodInfo.securitySchemes()); |
159 | 166 | $scope.fullResponseCodes = Object.keys($scope.fullResponses); |
|
341 | 348 | $elements.removeClass('raml-console-is-active'); |
342 | 349 | $container.find('.raml-console-body-' + $scope.getBodyId(value)).addClass('raml-console-is-active'); |
343 | 350 | }); |
344 | | - }] |
| 351 | + }], |
| 352 | + replace: true |
345 | 353 | }; |
346 | 354 | }; |
347 | 355 |
|
@@ -6724,7 +6732,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
6724 | 6732 | " <div class=\"raml-console-sidebar-row\">\n" + |
6725 | 6733 | " <p class=\"raml-console-sidebar-input-container raml-console-sidebar-input-container-custom\" ng-repeat=\"customParam in context.customParameters[type]\">\n" + |
6726 | 6734 | " <button class=\"raml-console-sidebar-input-delete\" ng-click=\"removeCutomParam(customParam)\"></button>\n" + |
6727 | | - " <label for=\"custom-header\" class=\"raml-console-sidebar-label raml-console-sidebar-label-custom\">\n" + |
| 6735 | + " <label class=\"raml-console-sidebar-label raml-console-sidebar-label-custom\">\n" + |
6728 | 6736 | " <input class=\"raml-console-sidebar-custom-input-for-label\" ng-model=\"customParam.name\" placeholder=\"custom key\">\n" + |
6729 | 6737 | " </label>\n" + |
6730 | 6738 | " <input name=\"custom-header\" class=\"raml-console-sidebar-input raml-console-sidebar-input-custom\" placeholder=\"custom value\" ng-model=\"customParam.value\">\n" + |
|
0 commit comments