From 5b6cd88557fd6fd5acf837e30be4110eae6ee084 Mon Sep 17 00:00:00 2001 From: Minasokoni Date: Thu, 9 Nov 2017 12:18:10 -0800 Subject: [PATCH 1/3] removed set width --- src/style/_models.scss | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/style/_models.scss b/src/style/_models.scss index 23b349d6..feb46a87 100644 --- a/src/style/_models.scss +++ b/src/style/_models.scss @@ -3,14 +3,16 @@ font-size: 12px; font-weight: 300; + @include text_code(); + .deprecated { - span, td { - color: $model-deprecated-font-color !important; - } + span, + td + { + color: $model-deprecated-font-color !important; + } } - - @include text_code(); &-toggle { font-size: 10px; @@ -87,7 +89,8 @@ background: rgba($model-hint-background-color,.7); } - p { + p + { margin: 0 0 1em 0; } } @@ -106,6 +109,7 @@ section.models h4 { margin: 0 0 5px 0; + border-bottom: 1px solid rgba($section-models-isopen-h4-border-bottom-color, .3); } } @@ -114,6 +118,7 @@ section.models font-size: 16px; display: flex; + align-items: center; margin: 0; padding: 10px 20px 10px 10px; @@ -122,7 +127,6 @@ section.models transition: all .2s; @include text_headline($section-models-h4-font-color); - align-items: center; svg { @@ -202,7 +206,7 @@ section.models &.deprecated { - opacity: .5; + opacity: .5; } } @@ -218,14 +222,16 @@ section.models { font-size: 16px; font-weight: 600; + margin-right: 1em; + @include text_headline($_color-delete); } span { - > span.model + > span.model { .brace-close { @@ -237,8 +243,8 @@ span .prop-name { display: inline-block; + margin-right: 1em; - width: 8em; } .prop-type From d92a27bdabff1a1c560a6d1014f531dba9636d1d Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 10 Nov 2017 10:40:03 -0800 Subject: [PATCH 2/3] Add failing tests --- test/core/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/core/utils.js b/test/core/utils.js index 918d8431..73861845 100644 --- a/test/core/utils.js +++ b/test/core/utils.js @@ -700,6 +700,14 @@ describe("utils", function() { } assertValidateParam(param, ["Required field is not provided"]) + // valid integer, but 0 is falsy in JS + param = { + required: true, + type: "integer", + value: 0 + } + assertValidateParam(param, []) + // valid integer param = { required: true, From 365585ceeab78cb962f4907b72f2494c5a244198 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Fri, 10 Nov 2017 10:45:19 -0800 Subject: [PATCH 3/3] Add check for `0` value for number and integer parameter values --- src/core/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/utils.js b/src/core/utils.js index 4595c798..8babdbd8 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -494,8 +494,8 @@ export const validateParam = (param, isXml, isOAS3 = false) => { let listCheck = type === "array" && Im.List.isList(value) && value.count() let fileCheck = type === "file" && value instanceof win.File let booleanCheck = type === "boolean" && (value || value === false) - let numberCheck = type === "number" && value - let integerCheck = type === "integer" && value + let numberCheck = type === "number" && (value || value === 0) + let integerCheck = type === "integer" && (value || value === 0) if ( required && !(stringCheck || arrayCheck || listCheck || fileCheck || booleanCheck || numberCheck || integerCheck) ) { errors.push("Required field is not provided")