Merge branch 'master' into ft/big-spec-performance
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
|
||||
@include text_code();
|
||||
|
||||
.deprecated
|
||||
{
|
||||
span, td {
|
||||
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
|
||||
{
|
||||
@@ -218,7 +222,9 @@ section.models
|
||||
{
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
|
||||
margin-right: 1em;
|
||||
|
||||
@include text_headline($_color-delete);
|
||||
}
|
||||
|
||||
@@ -237,8 +243,8 @@ span
|
||||
.prop-name
|
||||
{
|
||||
display: inline-block;
|
||||
|
||||
margin-right: 1em;
|
||||
width: 8em;
|
||||
}
|
||||
|
||||
.prop-type
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user