docs: generate Chats API docs from swagger annotations (#24830)

This commit is contained in:
david-fraley
2026-05-05 14:52:54 -04:00
committed by GitHub
parent cfce751b8a
commit e7360da974
13 changed files with 8597 additions and 422 deletions
+13
View File
@@ -209,12 +209,25 @@ func writeDocs(sections [][]byte) error {
continue
}
// Preserve existing state and description on children, keyed by
// title, so that callouts like `state: ["experimental"]` survive
// regeneration. Generated routes always overwrite Title and Path.
existingByTitle := make(map[string]route, len(child.Children))
for _, existing := range child.Children {
existingByTitle[existing.Title] = existing
}
var children []route
for _, mdf := range mdFiles {
docRoute := route{
Title: mdf.title,
Path: mdf.path,
}
if existing, ok := existingByTitle[mdf.title]; ok {
docRoute.State = existing.State
docRoute.Description = existing.Description
docRoute.IconPath = existing.IconPath
}
children = append(children, docRoute)
}