|
820 | 820 | return [arrayType.items]; |
821 | 821 | }; |
822 | 822 |
|
823 | | - $scope.getType = function (type) { |
824 | | - var newType = $scope.mergeType(type); |
825 | | - newType.type = RAML.Inspector.Types.ensureArray(newType.type); |
| 823 | + $scope.getType = function (property) { |
| 824 | + var newProperty = $scope.mergeProperty(property); |
| 825 | + newProperty.type = RAML.Inspector.Types.ensureArray(newProperty.type); |
826 | 826 |
|
827 | | - if (newType.type[0] === 'array') { |
828 | | - newType.type = getArrayTypes(newType).map(function (aType) { |
| 827 | + if (newProperty.type[0].type) { newProperty.type = newProperty.type[0].type; } |
| 828 | + |
| 829 | + if (newProperty.type[0] === 'array') { |
| 830 | + newProperty.type = getArrayTypes(newProperty).map(function (aType) { |
829 | 831 | return aType + '[]'; |
830 | 832 | }); |
831 | | - newType.properties = newType.items.properties; |
| 833 | + newProperty.properties = newProperty.items.properties; |
832 | 834 | } |
833 | 835 |
|
834 | | - return newType; |
| 836 | + return newProperty; |
835 | 837 | }; |
836 | 838 |
|
837 | 839 | var isPattern = function (propertyName) { |
|
842 | 844 | return ($scope.showSecuritySchemaProperties || !property[0].isFromSecurityScheme) && !isPattern(property[0].displayName); |
843 | 845 | }; |
844 | 846 |
|
845 | | - $scope.mergeType = function (type) { |
846 | | - var newType = angular.copy(type); |
| 847 | + $scope.mergeProperty = function (property) { |
| 848 | + var newProperty = angular.copy(property); |
847 | 849 |
|
848 | 850 | if (!$scope.isNestedProperty && $rootScope.types) { |
849 | | - return RAML.Inspector.Types.mergeType(newType, $rootScope.types); |
| 851 | + return RAML.Inspector.Types.mergeType(newProperty, $rootScope.types); |
850 | 852 | } |
851 | | - return newType; |
| 853 | + return newProperty; |
852 | 854 | }; |
853 | 855 |
|
854 | 856 | $scope.isNativeType = RAML.Inspector.Types.isNativeType; |
|
2704 | 2706 | $rootScope.$broadcast(TOGGLE_POPOVER); |
2705 | 2707 |
|
2706 | 2708 | $timeout(function () { |
2707 | | - $scope.selectedType = RAML.Inspector.Types.mergeType({ |
| 2709 | + $scope.selectedType = RAML.Inspector.Types.mergeProperty({ |
2708 | 2710 | displayName: type, |
2709 | 2711 | type: [type] |
2710 | 2712 | }, |
@@ -7157,7 +7159,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
7157 | 7159 | " <h1 ng-if=\"!disableTitle\" class=\"raml-console-title\">{{raml.title}}</h1>\n" + |
7158 | 7160 | "\n" + |
7159 | 7161 | "\n" + |
7160 | | - " <div ng-if=\"!disableDescription\" ng-init=\"actualSize = descriptionLimit\" >\n" + |
| 7162 | + " <div ng-if=\"!disableDescription && !!raml.description\" ng-init=\"actualSize = descriptionLimit\" >\n" + |
7161 | 7163 | " <div class=\"raml-console-root-description\" markdown=\"raml.description | limitTo : actualSize\"></div>\n" + |
7162 | 7164 | " <span>\n" + |
7163 | 7165 | " <a class=\"raml-console-show-more-less\"\n" + |
|
0 commit comments