新版不能使用protoc-gen-validator吗 · Issue #1843 · cloudwego/kitex · GitHub
Skip to content

新版不能使用protoc-gen-validator吗 #1843

Open

Description

@FengRuner

新版本中,使用protoc-gen-validator会提示proto 文件中报错,可以使用protoc,但是写了验证,kitex 工具生成文件就会出错,而且protoc-gen-validator包内, repeated int64 id = 1 [(api.vt).elem.gt="0"]; 这种写法生成的验证代码会有问题,类型不能匹配,如果想校验,应该怎么办呢

Activity

  1. HeyJavaBean commented on Aug 28, 2025

    @HeyJavaBean
    Contributor

    新版默认使用了 Prutal 来生成 pb 侧的代码:https://www.cloudwego.io/zh/docs/kitex/tutorials/code-gen/prutal/
    需要使用 protoc validator 的话,可以先设置环境变量 KITEX_TOOL_USE_PROTOC=1 切回 Protoc

  2. period331 commented on Sep 25, 2025

    @period331

    新版默认使用了 Prutal 来生成 pb 侧的代码:https://www.cloudwego.io/zh/docs/kitex/tutorials/code-gen/prutal/ 需要使用 protoc validator 的话,可以先设置环境变量 KITEX_TOOL_USE_PROTOC=1 切回 Protoc

    后续prutal/会支持类似protoc-validator的验证器功能吗?

  3. HeyJavaBean commented on Sep 26, 2025

    @HeyJavaBean
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions