Skip to content

Commit 4e8e42d

Browse files
authored
Merge pull request #24 from pitpit/fix/23-error-when-generating-markdown
fix: error when generating markdown from tests/openapi3/api-with-examples.yaml
2 parents 7e4712b + 93733fa commit 4e8e42d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/beautifier.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ const beautifyOperation = (operation, operationName, pathName, options) => {
101101
_.each(operation.responses, (response) => {
102102
if (response.content) {
103103
_.each(response.content, (contentType) => {
104-
beautifySchema(contentType.schema);
104+
if (contentType.schema) {
105+
beautifySchema(contentType.schema);
106+
}
105107
});
106108
}
107109
if (response.headers) {
108110
_.each(response.headers, (contentType) => {
109-
beautifySchema(contentType.schema);
111+
if (contentType.schema) {
112+
beautifySchema(contentType.schema);
113+
}
110114
});
111115
}
112116
});

0 commit comments

Comments
 (0)