Skip to content

Commit 67132ca

Browse files
authored
Merge branch 'master' into bug/3949-enum-selectable-values
2 parents 0fa532d + de7e091 commit 67132ca

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/core/components/response-body.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ export default class ResponseBody extends React.Component {
5757
(headers["Content-Description"] && (/File Transfer/i).test(headers["Content-Description"])) ||
5858
(headers["content-description"] && (/File Transfer/i).test(headers["content-description"]))) {
5959

60-
let contentLength = headers["content-length"] || headers["Content-Length"]
61-
if ( !(+contentLength) ) return null
62-
6360
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
6461

6562
if (!isSafari && "Blob" in window) {

src/core/utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,17 @@ export const validateParam = (param, isXml, isOAS3 = false) => {
473473
let required = param.get("required")
474474

475475
let paramDetails = isOAS3 ? param.get("schema") : param
476+
477+
if(!paramDetails) return errors
478+
476479
let maximum = paramDetails.get("maximum")
477480
let minimum = paramDetails.get("minimum")
478481
let type = paramDetails.get("type")
479482
let format = paramDetails.get("format")
480483
let maxLength = paramDetails.get("maxLength")
481484
let minLength = paramDetails.get("minLength")
482485
let pattern = paramDetails.get("pattern")
483-
486+
484487

485488
/*
486489
If the parameter is required OR the parameter has a value (meaning optional, but filled in)
@@ -506,7 +509,7 @@ export const validateParam = (param, isXml, isOAS3 = false) => {
506509
let err = validatePattern(value, pattern)
507510
if (err) errors.push(err)
508511
}
509-
512+
510513
if (maxLength || maxLength === 0) {
511514
let err = validateMaxLength(value, maxLength)
512515
if (err) errors.push(err)

test/core/utils.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,11 @@ describe("utils", function() {
321321
}
322322

323323
it("should check the isOAS3 flag when validating parameters", function() {
324-
// This should "skip" validation because there is no `schema.type` property
324+
// This should "skip" validation because there is no `schema` property
325325
// and we are telling `validateParam` this is an OAS3 spec
326326
param = fromJS({
327327
value: "",
328-
required: true,
329-
schema: {
330-
notTheTypeProperty: "string"
331-
}
328+
required: true
332329
})
333330
result = validateParam( param, false, true )
334331
expect( result ).toEqual( [] )

0 commit comments

Comments
 (0)