Skip to content

Commit 4a2cdc4

Browse files
committed
chore: add option to format to backward compatibility
1 parent b8935fe commit 4a2cdc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openapi-sampler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function sample(schema, options, spec) {
2929
let opts = Object.assign({}, defaults, options);
3030
clearCache();
3131
let result = traverse(schema, opts, spec).value;
32-
if (opts.format === 'xml') {
32+
if (opts?.format === 'xml') {
3333
return convertJsonToXml(result, schema);
3434
}
3535
return result;

0 commit comments

Comments
 (0)