fix(oas31): render responses with empty content field (#9664)

Refs #9199
This commit is contained in:
Vladimír Gorej
2024-03-06 14:20:45 +01:00
committed by GitHub
parent 4b4760d7fd
commit e2be707d7c
10 changed files with 356 additions and 13 deletions

View File

@@ -21,6 +21,9 @@ export const sampleFromSchemaGeneric = (
exampleOverride = undefined,
respectXML = false
) => {
// there is nothing to generate schema from
if (schema == null && exampleOverride === undefined) return undefined
if (typeof schema?.toJS === "function") schema = schema.toJS()
schema = typeCast(schema)

View File

@@ -27,6 +27,10 @@ function afterLoad({ fn, getSystem }) {
createXMLExample: fn.jsonSchema202012.createXMLExample,
memoizedSampleFromSchema: fn.jsonSchema202012.memoizedSampleFromSchema,
memoizedCreateXMLExample: fn.jsonSchema202012.memoizedCreateXMLExample,
getJsonSampleSchema: fn.jsonSchema202012.getJsonSampleSchema,
getYamlSampleSchema: fn.jsonSchema202012.getYamlSampleSchema,
getXmlSampleSchema: fn.jsonSchema202012.getXmlSampleSchema,
getSampleSchema: fn.jsonSchema202012.getSampleSchema,
},
getSystem()
)