Merge branch 'master' of github.com:swagger-api/swagger-ui into ft/3135-request-duration

This commit is contained in:
Owen Conti
2017-06-26 19:58:07 -06:00
11 changed files with 78 additions and 88 deletions

View File

@@ -9,7 +9,7 @@ const primitives = {
"number": () => 0,
"number_float": () => 0.0,
"integer": () => 0,
"boolean": () => true
"boolean": (schema) => typeof schema.default === "boolean" ? schema.default : true
}
const primitive = (schema) => {
@@ -74,6 +74,10 @@ export const sampleFromSchema = (schema, config={}) => {
return normalizeArray(schema["enum"])[0]
}
if (type === "file") {
return
}
return primitive(schema)
}