Ensure default module is always documented#44480
Open
amika-d wants to merge 1 commit into
Open
Conversation
The docerina tool currently skips modules that are not explicitly listed in the exportedModules list. This causes valid default modules in complex projects (e.g., ballerinax/mysql) to be ignored, resulting in a blank screen in the generated API docs. This commit updates the generator logic to bypass the export check for default modules, ensuring they are always documented. Fixes ballerina-platform#44476
📝 WalkthroughWalkthroughThe change modifies the module documentation generation logic to allow the default module to bypass export filtering, while maintaining restrictions on non-default modules. This targets a specific behavioral exception during module documentation map generation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
NipunaMadhushan
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Currently,
bal docgenerates a blank screen for the default module of certain libraries (likeballerinax/mysql) because thedocerinagenerator skips modules that are not explicitly listed in theexportedModuleslist.This PR fixes the issue by ensuring that Default Modules are always processed, regardless of the export list configuration.
Approach
Updated
BallerinaDocGenerator.javato bypass theexportedModulescheck ifmodule.isDefaultModule()is true. This ensures the main module of a package is never hidden by the documentation tool.Automation Tests
Verification Details:
Verified locally by running the patched tool against a reproduction of the
ballerinax/mysqlproject. The API documentation for the default module, which previously resulted in a blank screen, now generates correctly.Fixes #44476
ballerina-fix.mp4