* add tests for example feature
* refactor ParameterRow value setter logic
* aside: fix property access in sampleFromSchema
* prioritize media type examples for OAS3 responses
* use `example` in schema level example
* refactor: move stringify to utils
* prioritize media type examples in OAS3 request bodies
* modify nightwatch config
* fix parameter/response regressions
* reorder and broaden default value sources
* update lockfile
This commit is contained in:
kyle
2018-07-14 03:09:37 -04:00
committed by GitHub
parent bbbd1b93cb
commit 478d93ae08
13 changed files with 642 additions and 51 deletions

View File

@@ -760,3 +760,24 @@ export function deeplyStripKey(input, keyToStrip, predicate = () => true) {
return obj
}
export function stringify(thing) {
if (typeof thing === "string") {
return thing
}
if (thing.toJS) {
thing = thing.toJS()
}
if (typeof thing === "object" && thing !== null) {
try {
return JSON.stringify(thing, null, 2)
}
catch (e) {
return String(thing)
}
}
return thing.toString()
}