Merge branch 'master' into ft/big-spec-performance

This commit is contained in:
kyle
2017-11-10 16:45:20 -08:00
committed by GitHub
3 changed files with 26 additions and 12 deletions

View File

@@ -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")

View File

@@ -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

View File

@@ -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,