Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73d2e90e12 |
@@ -36,12 +36,7 @@ const RequestBody = ({
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if(
|
if(contentType === "application/octet-stream") {
|
||||||
contentType === "application/octet-stream"
|
|
||||||
|| contentType.indexOf("image/") === 0
|
|
||||||
|| contentType.indexOf("audio/") === 0
|
|
||||||
|| contentType.indexOf("video/") === 0
|
|
||||||
) {
|
|
||||||
const Input = getComponent("Input")
|
const Input = getComponent("Input")
|
||||||
|
|
||||||
if(!isExecute) {
|
if(!isExecute) {
|
||||||
|
|||||||
+1
-3
@@ -628,9 +628,7 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
|
|||||||
return memoizedCreateXMLExample(schema, config)
|
return memoizedCreateXMLExample(schema, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = memoizedSampleFromSchema(schema, config)
|
return JSON.stringify(memoizedSampleFromSchema(schema, config), null, 2)
|
||||||
|
|
||||||
return typeof res === "object" ? JSON.stringify(res, null, 2) : res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const parseSearch = () => {
|
export const parseSearch = () => {
|
||||||
|
|||||||
@@ -3,4 +3,3 @@ env:
|
|||||||
rules:
|
rules:
|
||||||
"react/prop-types": 1 # bah humbug
|
"react/prop-types": 1 # bah humbug
|
||||||
"no-unused-vars": 1 # unused vars in tests can be useful for indicating a full signature
|
"no-unused-vars": 1 # unused vars in tests can be useful for indicating a full signature
|
||||||
"no-global-assign": 1
|
|
||||||
|
|||||||
+1
-27
@@ -24,8 +24,7 @@ import {
|
|||||||
getCommonExtensions,
|
getCommonExtensions,
|
||||||
sanitizeUrl,
|
sanitizeUrl,
|
||||||
extractFileNameFromContentDispositionHeader,
|
extractFileNameFromContentDispositionHeader,
|
||||||
deeplyStripKey,
|
deeplyStripKey
|
||||||
getSampleSchema
|
|
||||||
} from "core/utils"
|
} from "core/utils"
|
||||||
import win from "core/window"
|
import win from "core/window"
|
||||||
|
|
||||||
@@ -1187,30 +1186,5 @@ describe("utils", function() {
|
|||||||
expect(sanitizeUrl({})).toEqual("")
|
expect(sanitizeUrl({})).toEqual("")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
describe("getSampleSchema", function() {
|
|
||||||
const oriDate = Date
|
|
||||||
|
|
||||||
before(function() {
|
|
||||||
Date = function () {
|
|
||||||
this.toISOString = function () {
|
|
||||||
return "2018-07-07T07:07:05.189Z"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
after(function() {
|
|
||||||
Date = oriDate
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should not unnecessarily stringify non-object values", function() {
|
|
||||||
// Given
|
|
||||||
const res = getSampleSchema({
|
|
||||||
type: "string",
|
|
||||||
format: "date-time"
|
|
||||||
})
|
|
||||||
|
|
||||||
// Then
|
|
||||||
expect(res).toEqual(new Date().toISOString())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user