Skip to content

fix: avoid adding empty events or models section in toc#221

Merged
Ayeshas09 merged 4 commits intodevfrom
ayeshas09/expand-webhooks-callbacks
Nov 11, 2025
Merged

fix: avoid adding empty events or models section in toc#221
Ayeshas09 merged 4 commits intodevfrom
ayeshas09/expand-webhooks-callbacks

Conversation

@Ayeshas09
Copy link
Contributor

@Ayeshas09 Ayeshas09 commented Nov 10, 2025

This PR fixes an issue where the TOC was adding Events and Models sections even when they were not present in the spec file. Now, these sections are generated only if the spec file contains the relevant data.

@Ayeshas09 Ayeshas09 self-assigned this Nov 10, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where empty Events or Models sections were being added to the table of contents (TOC). The solution refactors the TOC structure generator to conditionally include these sections only when they contain data.

Key Changes:

  • Introduced typed wrappers (Endpoints, Webhooks, Callbacks, Models) that combine data with expand flags
  • Modified section generator methods to return arrays instead of single objects, enabling conditional inclusion
  • Updated calling code to pass structured objects with both data and expand flags

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/application/portal/toc/toc-structure-generator.ts Refactored to use typed wrappers and return arrays from section generators, enabling conditional section inclusion
src/actions/portal/toc/new-toc.ts Updated to pass structured objects with data and expand flags to the TOC generator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ayeshas09 Ayeshas09 changed the base branch from dev to beta November 10, 2025 05:42
@Ayeshas09 Ayeshas09 changed the base branch from beta to dev November 10, 2025 05:43
Base automatically changed from dev to beta November 10, 2025 09:18
@aliasghar98 aliasghar98 changed the base branch from beta to dev November 10, 2025 09:25
@sonarqubecloud
Copy link

Copy link
Collaborator

@aliasghar98 aliasghar98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ayeshas09 Ayeshas09 merged commit d538a4e into dev Nov 11, 2025
6 checks passed
@Ayeshas09 Ayeshas09 deleted the ayeshas09/expand-webhooks-callbacks branch November 11, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants