diff --git a/generator/templates/changelog.mdx.ejs b/generator/templates/changelog.mdx.ejs index 023fba46..08491b74 100644 --- a/generator/templates/changelog.mdx.ejs +++ b/generator/templates/changelog.mdx.ejs @@ -9,7 +9,7 @@ tags: [ "api" + apiVersion, hasBreakingChanges ? "breaking" : undefined, - ...(new Set(changelog.map(l => getOperationById(spec, l.operationId).operation.tags[0]))) + ...(new Set(changelog.map(l => getOperationById(spec, l.operationId)?.operation.tags[0]).filter(t => t !== undefined))) ].filter(s => s !== undefined) }) %> --- @@ -57,7 +57,7 @@ The following API endpoints have changed: <% for ([operationId, changes] of groupedChangelog.entries()) { %> -### Changes in "<%- canonicalizeTitle(getOperationById(spec, operationId).operation.summary) %>" +### Changes in "<%- canonicalizeTitle(getOperationById(spec, operationId)?.operation.summary) ?? operationId %>" <% for (change of changes) { %> - <% if (change.level === 3) { %>⚠️ **Breaking:** <% } %><%- change.text %>