Compare commits

..
Author SHA1 Message Date
kyle 9709df82d3 v3.17.3 (#4706)
* fix: handle formencoded array data correctly

* v3.17.3

* rebuild dist
2018-07-07 02:56:54 -05:00
kyle 4055f51b93 fix: support multimedia media types for file upload (#4705) 2018-07-07 02:36:48 -05:00
kyle 8f65483510 fix: handle urlencoded array data correctly + don't stringify non-object sample values (#4704)
* fix: handle urlencoded array data correctly

* fix: don't stringify non-object sample values

* fix linter
2018-07-07 02:30:40 -05:00
11 changed files with 51 additions and 17 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
------------------ | ------------ | -------------------------- | -----
3.17.2 | 2018-06-16 | 2.0, 3.0 | [tag v3.17.2](https://github.com/swagger-api/swagger-ui/tree/v3.17.2)
3.17.3 | 2018-06-16 | 2.0, 3.0 | [tag v3.17.3](https://github.com/swagger-api/swagger-ui/tree/v3.17.3)
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)
+7 -7
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "3.17.2",
"version": "3.17.3",
"main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [
@@ -36,7 +36,12 @@ const RequestBody = ({
return null
}
if(contentType === "application/octet-stream") {
if(
contentType === "application/octet-stream"
|| contentType.indexOf("image/") === 0
|| contentType.indexOf("audio/") === 0
|| contentType.indexOf("video/") === 0
) {
const Input = getComponent("Input")
if(!isExecute) {
+3 -1
View File
@@ -628,7 +628,9 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
return memoizedCreateXMLExample(schema, config)
}
return JSON.stringify(memoizedSampleFromSchema(schema, config), null, 2)
const res = memoizedSampleFromSchema(schema, config)
return typeof res === "object" ? JSON.stringify(res, null, 2) : res
}
export const parseSearch = () => {
+1
View File
@@ -3,3 +3,4 @@ env:
rules:
"react/prop-types": 1 # bah humbug
"no-unused-vars": 1 # unused vars in tests can be useful for indicating a full signature
"no-global-assign": 1
+27 -1
View File
@@ -24,7 +24,8 @@ import {
getCommonExtensions,
sanitizeUrl,
extractFileNameFromContentDispositionHeader,
deeplyStripKey
deeplyStripKey,
getSampleSchema
} from "core/utils"
import win from "core/window"
@@ -1186,5 +1187,30 @@ describe("utils", function() {
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())
})
})
})