fix(sample-gen): xml attr with media-type example value (#7045)

This commit is contained in:
Mahtis Michel
2021-03-10 21:44:54 +01:00
committed by GitHub
parent 219d886265
commit 902241cf7e
2 changed files with 20 additions and 5 deletions

View File

@@ -307,12 +307,8 @@ export const sampleFromSchemaGeneric = (schema, config={}, exampleOverride = und
if (schema && props[propName] && props[propName].writeOnly && !includeWriteOnly) {
continue
}
if (schema && props[propName] && props[propName].xml && props[propName].xml.attribute && !(example && example[propName])) {
_attr[props[propName].xml.name || propName] = sample[propName]
continue
}
if (schema && props[propName] && props[propName].xml && props[propName].xml.attribute) {
_attr[props[propName].xml.name || propName] = example[propName]
_attr[props[propName].xml.name || propName] = sample[propName]
continue
}
addPropertyToResult(propName, sample[propName])