Skip to content

fix(api): populate and document subject tag total count#1124

Open
huoshen80 wants to merge 1 commit into
bangumi:masterfrom
huoshen80:fix/subject-tag-total-count
Open

fix(api): populate and document subject tag total count#1124
huoshen80 wants to merge 1 commit into
bangumi:masterfrom
huoshen80:fix/subject-tag-total-count

Conversation

@huoshen80

Copy link
Copy Markdown

背景

搜索接口已经正确填充条目标签的 total_cont,但 ToSubjectV0ToSlimSubjectV0 转换时遗漏了该字段,导致相关接口始终将其序列化为 0。同时,OpenAPI 的 Tag schema 也没有声明该字段。

total_cont 中的 cont 疑似 count 的历史拼写错误。由于它已经是 v0 API 对外暴露的字段名,本 PR 为保持兼容继续沿用 total_cont,不做破坏性重命名。

修改内容

  • ToSubjectV0 中填充标签的总使用次数
  • ToSlimSubjectV0 中填充标签的总使用次数
  • 在 OpenAPI Tag schema 中声明并说明 total_cont
  • 为两个转换函数添加回归测试

测试

  • go test -tags test ./web/res/...
  • yarn prettier --check openapi/components/subject_tags.yaml
  • yarn run test

@mergify

mergify Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@huoshen80 huoshen80 changed the title fix(api): 补充条目标签总使用次数及文档 fix(api): populate and document subject tag total count Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant