Parse Root and Expanded attributes on navigation <Group> elements#61
Merged
Conversation
ParseGroupConfig only read Name, Icon, and Tag, so a template <Group> could not set GroupConfig.Root or GroupConfig.Expanded even though both exist on the model and serialize to docs.json. This made it impossible to give identically named groups (e.g. repeated "Episodes"/"Planning" groups across sibling brand sections) a distinct root page, which Mintlify uses to keep their sidebar expand/collapse state independent. - ParseGroupConfig now reads the optional Root (string) and Expanded (bool, via the codebase's IsNullOrWhiteSpace + bool.TryParse convention) attributes. Both remain optional; omitting them leaves the properties null. - Documented the supported attributes on the method with remarks + an example. - Added tests: Root present/absent, Expanded true/false/cased, and missing/invalid Expanded left null. Extended the complete-attributes test. Also pins System.Security.Cryptography.Xml above the transitively-resolved 9.0.0 (high-severity advisories GHSA-37gx-xxp4-5rgx, GHSA-w3x6-4m5h-cxqf) so restore passes with NuGet audit enabled. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
ParseGroupConfigonly readName,Icon, andTag, so a template<Group>could not setGroupConfig.RootorGroupConfig.Expanded— even though both exist on the model and serialize todocs.json. That made it impossible to give identically-named groups a distinct root page.This matters for sidebars that repeat group names across sibling sections (e.g. a "Brands" tab where each brand has its own
Episodes,Planning,Competitive Analysis, … groups). Mintlify keys a group's sidebar expand/collapse state off its identity; without a uniqueroot, the same-named groups expand/collapse together. SettingRootper group decouples them (and gives each a landing page).Changes
ParseGroupConfignow reads the optionalRoot(string) andExpanded(bool) attributes.Root→GroupConfig.Root, optional (null when omitted — no required check).Expanded→GroupConfig.Expanded, parsed with the existing!IsNullOrWhiteSpace && bool.TryParseconvention; left null when absent or non-boolean.<remarks>+<example>documenting all supported<Group>attributes.GenerateDocumentationTaskTests):Rootpresent/absent,Expandedtrue/false/True, and missing/invalidExpanded→ null; extended the complete-attributes test.System.Security.Cryptography.Xmlabove the transitive9.0.0(high-severity advisoriesGHSA-37gx-xxp4-5rgx,GHSA-w3x6-4m5h-cxqf), per TFM (net10 →10.*, net9/8 →9.*), so restore passes with NuGet audit enabled.Verification
ParseGroupConfigtest suite: 22 passed, 0 failed (net10, MSTest/MTP runner).Notes
Both new attributes are fully optional and backward-compatible — existing templates are unaffected.
🤖 Generated with Claude Code