Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ca7486143 | ||
|
|
d7aabb2a4b | ||
|
|
5b7e422d75 | ||
|
|
9709df82d3 | ||
|
|
4055f51b93 | ||
|
|
8f65483510 |
@@ -4,14 +4,6 @@ about: Suggest an new feature or enhancement for this project
|
||||
|
||||
---
|
||||
|
||||
### Q&A (please complete the following information)
|
||||
- OS: [e.g. macOS]
|
||||
- Browser: [e.g. chrome, safari]
|
||||
- Version: [e.g. 22]
|
||||
- Method of installation: [e.g. npm, dist assets]
|
||||
- Swagger-UI version: [e.g. 3.10.0]
|
||||
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]
|
||||
|
||||
### Content & configuration
|
||||
|
||||
Swagger/OpenAPI definition:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Swagger UI
|
||||
# Swagger UI loves Jenkins still
|
||||
|
||||
[](http://badge.fury.io/js/swagger-ui)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Vendored
+7
-7
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -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
@@ -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 = () => {
|
||||
|
||||
@@ -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
@@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user