fix: string samples should also be json stringified. (#6412)

fixes #6120
This commit is contained in:
Mahtis Michel
2020-09-21 21:16:26 +02:00
committed by GitHub
parent 52360a0612
commit 821ba887a6
2 changed files with 15 additions and 3 deletions

View File

@@ -560,7 +560,9 @@ export const getSampleSchema = (schema, contentType="", config={}) => {
const res = memoizedSampleFromSchema(schema, config)
return typeof res === "object" ? JSON.stringify(res, null, 2) : res
return typeof res === "object" || typeof res === "string"
? JSON.stringify(res, null, 2)
: res
}
export const parseSearch = () => {