{"id":43001883,"url":"https://github.com/protoc-gen/protoc-gen-validatex","last_synced_at":"2026-01-31T04:08:32.309Z","repository":{"id":274142841,"uuid":"921466715","full_name":"protoc-gen/protoc-gen-validatex","owner":"protoc-gen","description":"🔨 protoc-gen-validatex is a protoc plugin that auto-generates validation rules for Protobuf messages, with easy configuration and i18n support for multilingual error messages.","archived":false,"fork":false,"pushed_at":"2025-04-04T08:00:35.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T09:21:36.323Z","etag":null,"topics":["i18n","protoc","protoc-gen","protoc-gen-validate","protoc-plugin","protocol-buffers","validation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/protoc-gen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T02:04:06.000Z","updated_at":"2025-04-04T08:00:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ab676c3-4398-49df-b381-736e6482c4f2","html_url":"https://github.com/protoc-gen/protoc-gen-validatex","commit_stats":null,"previous_names":["protoc-gen/protoc-gen-validatex"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/protoc-gen/protoc-gen-validatex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protoc-gen%2Fprotoc-gen-validatex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protoc-gen%2Fprotoc-gen-validatex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protoc-gen%2Fprotoc-gen-validatex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protoc-gen%2Fprotoc-gen-validatex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protoc-gen","download_url":"https://codeload.github.com/protoc-gen/protoc-gen-validatex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protoc-gen%2Fprotoc-gen-validatex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28928896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","protoc","protoc-gen","protoc-gen-validate","protoc-plugin","protocol-buffers","validation"],"created_at":"2026-01-31T04:08:30.876Z","updated_at":"2026-01-31T04:08:32.303Z","avatar_url":"https://github.com/protoc-gen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eprotoc-gen-validatex\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n| [English](https://github.com/protoc-gen/protoc-gen-validatex) | [中文简体](docs/README_zh-CN.md) |\n\n\u003c/div\u003e\n\n---\n\n`protoc-gen-validatex` is a plugin for `protoc` designed to simplify and automate the generation of common parameter validation rules. By using parameter options and extensions, users can easily configure validation rules and automatically generate the corresponding validators. The plugin also supports integration with internationalization (i18n), allowing the generation of multilingual error messages based on different language environments, thereby enhancing the user experience.\n\n## Key Features\n- **Automated Rule Generation**: This is a fundamental feature of the `protoc` plugin, enabling automatic generation of common validation rules.\n- **Multilingual Support**: Naturally supports multiple languages, allowing quick adaptation to various projects and business scenarios.\n- **MIT License**: Users can freely fork and modify the project without concerns, under the MIT license.\n\n## Quick Start\nYou can refer to the [example](./example) for a quick start. Below are some code snippets for reference:\n\n### Definition\n```proto\nsyntax = \"proto3\";\n\noption go_package = \"github.com/protoc-gen/protoc-gen-validatex/example;main\";\n\nimport \"validatex/validatex.proto\";\n\nmessage SignInRequest {\n  string email = 1 [(validatex.rules).string.email = true];\n  string password = 2 [(validatex.rules).string = {min_len: 5, max_len: 50}];\n}\n```\n\n### Generation\n```shell\ngo install github.com/protoc-gen/protoc-gen-validatex\nprotoc --proto_path=. \\\n       --go_out=paths=source_relative:. \\\n       --validatex_out=paths=source_relative:. \\\n       --validatex_opt=i18n_dir=./example/i18n \\\n       ./example/*.proto\n```\n\n### Usage:\n```go\npackage main\n\nimport (\n    \"context\"\n    \"github.com/protoc-gen/protoc-gen-validatex/pkg/validatex\"\n    \"log\"\n)\n\nfunc main() {\n    // Create a SignInRequest instance\n    req := \u0026SignInRequest{\n        Email:    \"test.com\",\n        Password: \"password123\",\n    }\n\n    ctx := context.WithValue(context.Background(), validatex.KeyXLang, \"zh\")\n\n    // Validate the SignInRequest instance\n    if err := req.Validate(ctx); err != nil {\n        log.Fatalf(\"validation failed: %v\", err)\n    }\n\n    log.Println(\"validation passed\")\n}\n```\n\n## License\nThis project is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotoc-gen%2Fprotoc-gen-validatex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotoc-gen%2Fprotoc-gen-validatex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotoc-gen%2Fprotoc-gen-validatex/lists"}