{"id":16681425,"url":"https://github.com/linka-cloud/prost-validate","last_synced_at":"2025-03-17T00:32:41.594Z","repository":{"id":257551800,"uuid":"858657530","full_name":"linka-cloud/prost-validate","owner":"linka-cloud","description":"Prost support for protoc-gen-validate annotations","archived":false,"fork":false,"pushed_at":"2024-10-16T08:41:13.000Z","size":314,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-18T01:43:56.547Z","etag":null,"topics":["grpc","protobuf","protocol-buffers","rust","rust-build","rust-lang","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linka-cloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2024-09-17T09:55:44.000Z","updated_at":"2024-10-17T13:31:27.000Z","dependencies_parsed_at":"2024-09-17T11:07:30.107Z","dependency_job_id":"4f10d884-174c-405d-b330-b9de09b821b2","html_url":"https://github.com/linka-cloud/prost-validate","commit_stats":null,"previous_names":["linka-cloud/prost-validate"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprost-validate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprost-validate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprost-validate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linka-cloud%2Fprost-validate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linka-cloud","download_url":"https://codeload.github.com/linka-cloud/prost-validate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669377,"owners_count":16860861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["grpc","protobuf","protocol-buffers","rust","rust-build","rust-lang","rust-library"],"created_at":"2024-10-12T14:04:07.223Z","updated_at":"2024-10-27T11:35:43.611Z","avatar_url":"https://github.com/linka-cloud.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MSRV](https://img.shields.io/badge/rustc-1.74+-blue.svg)\n[![Continuous integration](https://github.com/linka-cloud/prost-validate/actions/workflows/ci_derive.yml/badge.svg)](https://github.com/linka-cloud/prost-validate/actions/workflows/ci_derive.yml)\n![Apache 2.0](https://img.shields.io/badge/license-Apache2.0-blue.svg)\n\n# Prost Validate\n\nThis is a Rust implementation of [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate).\n\nIt must be used with [prost](https://github.com/tokio-rs/prost) generated code.\n\nAll validation rules are documented in the [proto file](../prost-validate-types/proto/validate/validate.proto)\nor in the [protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate/blob/v1.1.0/README.md#constraint-rules)\ndocumentation.\n\nIt provides two implementations:\n\n- A derive based implementation in the [prost-validate](prost-validate/README.md) crate.\n- A reflection based implementation in the [prost-reflect-validate](prost-reflect-validate/README.md) crate.\n\nThe [test suite](prost-validate-tests) adapted from\nthe [protoc-gen-validate harness tests](https://github.com/bufbuild/protoc-gen-validate/blob/v1.1.0/tests/harness/executor/cases.go)\nis shared between the two implementations.\n\nHere are the benchmarks for the tests suite of the two implementations:\n\n`prost-reflect-validate`:\n\n```\nharness reflect         time:   [14.849 ms 15.128 ms 15.459 ms]\n```\n\n`prost-validate`:\n\n```\nharness derive          time:   [2.5635 ms 2.5780 ms 2.5967 ms]\n```\n\n### Constraint Rule Comparison\n\n#### Global\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| disabled        |   ✅    |    ✅    |\n\n#### Numerics\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| const           |   ✅    |    ✅    |\n| lt/lte/gt/gte   |   ✅    |    ✅    |\n| in/not_in       |   ✅    |    ✅    |\n\n#### Bools\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| const           |   ✅    |    ✅    |\n\n#### Strings\n\n| Constraint Rule        | Derive | Reflect |\n|------------------------|:------:|:-------:|\n| const                  |   ✅    |    ✅    |\n| len/min\\_len/max_len   |   ✅    |    ✅    |\n| min\\_bytes/max\\_bytes  |   ✅    |    ✅    |\n| pattern                |   ✅    |    ✅    |\n| prefix/suffix/contains |   ✅    |    ✅    |\n| contains/not_contains  |   ✅    |    ✅    |\n| in/not_in              |   ✅    |    ✅    |\n| email                  |   ✅    |    ✅    |\n| hostname               |   ✅    |    ✅    |\n| address                |   ✅    |    ✅    |\n| ip                     |   ✅    |    ✅    |\n| ipv4                   |   ✅    |    ✅    |\n| ipv6                   |   ✅    |    ✅    |\n| uri                    |   ✅    |    ✅    |\n| uri_ref                |   ✅    |    ✅    |\n| uuid                   |   ✅    |    ✅    |\n| well_known_regex       |   ✅    |    ✅    |\n\n#### Bytes\n\n| Constraint Rule        | Derive | Reflect |\n|------------------------|:------:|:-------:|\n| const                  |   ✅    |    ✅    |\n| len/min\\_len/max_len   |   ✅    |    ✅    |\n| pattern                |   ✅    |    ✅    |\n| prefix/suffix/contains |   ✅    |    ✅    |\n| in/not_in              |   ✅    |    ✅    |\n| ip                     |   ✅    |    ✅    |\n| ipv4                   |   ✅    |    ✅    |\n| ipv6                   |   ✅    |    ✅    |\n\n#### Enums\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| const           |   ✅    |    ✅    |\n| defined_only    |   ✅    |    ✅    |\n| in/not_in       |   ✅    |    ✅    |\n\n#### Messages\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| skip            |   ✅    |    ✅    |\n| required        |   ✅    |    ✅    |\n\n#### Repeated\n\n| Constraint Rule      | Derive | Reflect |\n|----------------------|:------:|:-------:|\n| min\\_items/max_items |   ✅    |    ✅    |\n| unique               |   ✅    |    ✅    |\n| items                |   ✅    |    ✅    |\n\n#### Maps\n\n| Constraint Rule      | Derive | Reflect |\n|----------------------|:------:|:-------:|\n| min\\_pairs/max_pairs |   ✅    |    ✅    |\n| no_sparse            |   ❓    |    ❓    |\n| keys                 |   ✅    |    ✅    |\n| values               |   ✅    |    ✅    |\n\n#### OneOf\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| required        |   ✅    |    ✅    |\n\n#### WKT Scalar Value Wrappers\n\n| Constraint Rule    | Derive | Reflect |\n|--------------------|:------:|:-------:|\n| wrapper validation |   ✅    |    ✅    |\n\n#### WKT Any\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| required        |   ✅    |    ✅    |\n| in/not_in       |   ✅    |    ✅    |\n\n#### WKT Duration\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| required        |   ✅    |    ✅    |\n| const           |   ✅    |    ✅    |\n| lt/lte/gt/gte   |   ✅    |    ✅    |\n| in/not_in       |   ✅    |    ✅    |\n\n#### WKT Timestamp\n\n| Constraint Rule | Derive | Reflect |\n|-----------------|:------:|:-------:|\n| required        |   ✅    |    ✅    |\n| const           |   ✅    |    ✅    |\n| lt/lte/gt/gte   |   ✅    |    ✅    |\n| lt_now/gt_now   |   ✅    |    ✅    |\n| within          |   ✅    |    ✅    |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fprost-validate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinka-cloud%2Fprost-validate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinka-cloud%2Fprost-validate/lists"}