fix(sample-gen): oas3 form-data object should generate example (#7355)
This commit is contained in:
@@ -165,14 +165,16 @@ const RequestBody = ({
|
||||
const useInitialValue = useInitialValFromSchemaSamples || useInitialValFromEnum
|
||||
|
||||
let initialValue = ""
|
||||
if(type === "array" && !useInitialValue) {
|
||||
if (type === "array" && !useInitialValue) {
|
||||
initialValue = []
|
||||
} else if (useInitialValue) {
|
||||
}
|
||||
if (type === "object" || useInitialValue) {
|
||||
// TODO: what about example or examples from requestBody could be passed as exampleOverride
|
||||
initialValue = getSampleSchema(prop, false, {
|
||||
includeWriteOnly: true
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof initialValue !== "string" && type === "object") {
|
||||
initialValue = stringify(initialValue)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user