|
743 | 743 | isNestedProperty: '=', |
744 | 744 | hideTypeLinks: '=', |
745 | 745 | hidePropertyDetails: '=', |
746 | | - showExamples: '=' |
| 746 | + showExamples: '=', |
| 747 | + showSecuritySchemaProperties: '=' |
747 | 748 | }, |
748 | 749 | controller: ['$scope', '$rootScope', function ($scope, $rootScope) { |
749 | 750 | if (!Array.isArray($scope.list)) { |
750 | 751 | $scope.listArray = Object.keys($scope.list).map(function (key) { |
751 | 752 | return $scope.list[key]; |
752 | 753 | }); |
753 | 754 |
|
754 | | - $scope.listArray = RAML.Inspector.Properties.normalizeNamedParameters($scope.list); |
| 755 | + $scope.listArray = RAML.Inspector.Properties.normalizeNamedParameters($scope.listArray); |
755 | 756 | } else { |
756 | 757 | $scope.listArray = $scope.list; |
757 | 758 | } |
758 | 759 |
|
| 760 | + var getArrayTypes = function(arrayType) { |
| 761 | + if (arrayType.items.type || Array.isArray(arrayType.items.type)) { |
| 762 | + return arrayType.items.type; |
| 763 | + } |
| 764 | + |
| 765 | + return [arrayType.items]; |
| 766 | + }; |
| 767 | + |
759 | 768 | $scope.getType = function (type) { |
760 | 769 | var newType = $scope.mergeType(type); |
761 | 770 | newType.type = RAML.Inspector.Types.ensureArray(newType.type); |
762 | 771 |
|
763 | 772 | if (newType.type[0] === 'array') { |
764 | | - newType.type = newType.items.type.map(function (aType) { |
| 773 | + newType.type = getArrayTypes(newType).map(function (aType) { |
765 | 774 | return aType + '[]'; |
766 | 775 | }); |
767 | 776 | newType.properties = newType.items.properties; |
|
770 | 779 | return newType; |
771 | 780 | }; |
772 | 781 |
|
| 782 | + var isPattern = function (propertyName) { |
| 783 | + return propertyName.match(PATTERN_PATTERN); |
| 784 | + }; |
| 785 | + |
| 786 | + $scope.isPropertyVisible = function(property) { |
| 787 | + return ($scope.showSecuritySchemaProperties || !property[0].isFromSecurityScheme) && !isPattern(property[0].displayName); |
| 788 | + }; |
| 789 | + |
773 | 790 | $scope.mergeType = function (type) { |
774 | 791 | var newType = angular.copy(type); |
775 | 792 |
|
|
781 | 798 |
|
782 | 799 | $scope.isNativeType = RAML.Inspector.Types.isNativeType; |
783 | 800 |
|
784 | | - $scope.isPattern = function (propertyName) { |
785 | | - return propertyName.match(PATTERN_PATTERN); |
786 | | - }; |
787 | | - |
788 | 801 | $scope.isSchema = RAML.Inspector.Types.isSchema; |
789 | 802 |
|
790 | 803 | $scope.isCollapsible = function isCollapsible(property) { |
@@ -6508,16 +6521,16 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
6508 | 6521 | " <li class=\"raml-console-documentation-scheme\" ng-class=\"{'raml-console-is-active':isSchemeSelected(value)}\" ng-click=\"selectDocumentationScheme(value)\" ng-repeat=\"(key, value) in securitySchemes\">{{value.name}}</li>\n" + |
6509 | 6522 | " </ol>\n" + |
6510 | 6523 | "\n" + |
6511 | | - " <p ng-if\"documentationSchemeSelected.description\" markdown=\"documentationSchemeSelected.description\" class=\"raml-console-marked-content\"></p>\n" + |
| 6524 | + " <p ng-if=\"documentationSchemeSelected.description\" markdown=\"documentationSchemeSelected.description\" class=\"raml-console-marked-content\"></p>\n" + |
6512 | 6525 | "\n" + |
6513 | 6526 | " <section class=\"raml-console-resource-section raml-console-scheme-headers\" ng-if=\"documentationSchemeSelected.describedBy.headers\">\n" + |
6514 | 6527 | " <h4 class=\"raml-console-resource-heading-a\">Headers</h4>\n" + |
6515 | | - " <properties list=\"documentationSchemeSelected.describedBy.headers\" show-examples=\"true\"></properties>\n" + |
| 6528 | + " <properties list=\"documentationSchemeSelected.describedBy.headers\" show-security-schema-properties=\"true\" show-examples=\"true\"></properties>\n" + |
6516 | 6529 | " </section>\n" + |
6517 | 6530 | "\n" + |
6518 | 6531 | " <section class=\"raml-console-resource-section raml-console-scheme-query-parameters\" ng-if=\"documentationSchemeSelected.describedBy.queryParameters\">\n" + |
6519 | 6532 | " <h4 class=\"raml-console-resource-heading-a\">Query Parameters</h4>\n" + |
6520 | | - " <properties list=\"documentationSchemeSelected.describedBy.queryParameters\" show-examples=\"true\"></properties>\n" + |
| 6533 | + " <properties list=\"documentationSchemeSelected.describedBy.queryParameters\" show-security-schema-properties=\"true\" show-examples=\"true\"></properties>\n" + |
6521 | 6534 | " </section>\n" + |
6522 | 6535 | "\n" + |
6523 | 6536 | " <section class=\"raml-console-resource-section raml-console-scheme-responses\" ng-if=\"documentationSchemeSelected.describedBy.responses\">\n" + |
@@ -6717,7 +6730,9 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
6717 | 6730 |
|
6718 | 6731 | $templateCache.put('directives/properties.tpl.html', |
6719 | 6732 | "<div>\n" + |
6720 | | - " <div class=\"raml-console-resource-param\" ng-repeat=\"property in listArray\" ng-if=\"!property[0].isFromSecurityScheme && !isPattern(property[0].displayName)\" ng-init=\"vm.isCollapsed = !!collapsible\">\n" + |
| 6733 | + " <div class=\"raml-console-resource-param\" ng-repeat=\"property in listArray\"\n" + |
| 6734 | + " ng-if=\"isPropertyVisible(property)\"\n" + |
| 6735 | + " ng-init=\"vm.isCollapsed = !!collapsible\">\n" + |
6721 | 6736 | " <div ng-init=\"type = getType(property[0])\">\n" + |
6722 | 6737 | " <h4 class=\"raml-console-resource-param-heading\" style=\"position: relative\">\n" + |
6723 | 6738 | " <span ng-if=\"isCollapsible(type)\" ng-click=\"vm.isCollapsed = !vm.isCollapsed\" style=\"cursor: pointer\">{{ vm.isCollapsed ? '▶' : '▼' }}</span> {{type.displayName}}\n" + |
|
0 commit comments