{"id":23112956,"url":"https://github.com/vbfox/proto-filter","last_synced_at":"2025-04-04T00:11:39.553Z","repository":{"id":143142594,"uuid":"235668559","full_name":"vbfox/proto-filter","owner":"vbfox","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-20T23:30:26.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T00:46:23.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/vbfox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-01-22T21:16:32.000Z","updated_at":"2024-06-19T07:36:44.948Z","dependencies_parsed_at":null,"dependency_job_id":"ffec90a7-5e8c-40c3-b53a-38a652edf4a9","html_url":"https://github.com/vbfox/proto-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fproto-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fproto-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fproto-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbfox%2Fproto-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbfox","download_url":"https://codeload.github.com/vbfox/proto-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097995,"owners_count":20883128,"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":[],"created_at":"2024-12-17T02:21:13.092Z","updated_at":"2025-04-04T00:11:39.523Z","avatar_url":"https://github.com/vbfox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# proto-filter\n\n## Configuration\n\nAll samples here assume the following content in simple.proto :\n\n```protobuf\nsyntax = \"proto3\";\n\nmessage SearchRequest {\n  string query = 1;\n  int32 page_number = 2;\n  int32 result_per_page = 3;\n}\n\nmessage SearchResponse {\n  repeated Result results = 1;\n  SearchRequest request = 2;\n}\n\nmessage Result {\n  string url = 1;\n  string title = 2;\n  repeated string snippets = 3;\n}\n```\n\nConfiguration contain 2 sections :\n\n```yaml\ninclude:\n    - simple.proto:\n        - SearchResponse\nexclude:\n    - simple.proto:\n        - SearchResponse:\n            - useless\n        - SearchRequest:\n            - page_number\n        - Result:\n            - snippets\n```\n\n* The default is to include nothing (An empty file is generated)\n* Leafs specified in `include` are included for example the `simple.proto/SearchResponse` message will be included.\n* Parents of included elements are included (A `simple.proto` file will be created) but not their content\n* Anything inside an included element is implicitely included (Fields \u0026 Sub messages)\n* Any message referenced by an included element is included implicitely (Recursively)\n\n\n### The file hierarchy\n\nFiles are specified by their file names and path from the root of the proto path.\n\n### Specifying fields\n\nFields can be specified in multiple ways:\n\n* Designating all fields with a start (`*`)\n* By field name (`result_per_page`)\n* By field number (`3`)\n* Designating all fields with a start (`*`)\n\n### Selecting the fields of an implicitly included message\n\nThis specific configuration:\n\n```yaml\ninclude:\n    - simple.proto:\n        - SearchRequest:\n            - query\n```\n\nWill produce :\n\n```protobuf\nsyntax = \"proto3\";\n\nmessage SearchRequest {\n  string query = 1;\n}\n```\n\nBut \n\n```yaml\ninclude:\n    - simple.proto:\n        - SearchResponse\n        - SearchRequest:\n            - query\n```\n\nWill keep all fields of `SearchRequest` because `SearchResponse` include a field of this type so it's implicitely including all the fields.\n\nTo keep only `query` all fields need to be explicitely excluded:\n\n```yaml\ninclude:\n    - simple.proto:\n        - SearchResponse\n        - SearchRequest:\n            - query\nexclude:\n    - simple.proto:\n        - SearchRequest:\n            - *\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fproto-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbfox%2Fproto-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbfox%2Fproto-filter/lists"}