fix(api): populate and document subject tag total count#1124
Merged
Conversation
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Contributor
Author
|
@trim21 看起来合并后的 vulnerability-scan 失败是因为项目当前使用 Go 1.26.4, 我看文档那边目前还没自动构建,虽然之前文档没写出 total_cont 字段,但是请求会得到这个字段。 因为我软件打算使用这个字段过滤排除掉一些低质量 tag,所以想问一下这个错误拼写,你打算修正还是保留。 |
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.
背景
搜索接口已经正确填充条目标签的
total_cont,但ToSubjectV0和ToSlimSubjectV0转换时遗漏了该字段,导致相关接口始终将其序列化为0。同时,OpenAPI 的 Tag schema 也没有声明该字段。total_cont中的cont疑似count的历史拼写错误。由于它已经是 v0 API 对外暴露的字段名,本 PR 为保持兼容继续沿用total_cont,不做破坏性重命名。修改内容
ToSubjectV0中填充标签的总使用次数ToSlimSubjectV0中填充标签的总使用次数total_cont测试
go test -tags test ./web/res/...yarn prettier --check openapi/components/subject_tags.yamlyarn run test