Skip to content

Commit

Permalink
Add IGNORE_IF_UNPOPULATED for PluginInfo URL fields (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored Sep 28, 2024
1 parent 96622f7 commit 0b398d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion buf/plugin/info/v1/license.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ message License {
// The raw text of the license.
string text = 2;
// The url that contains the license
string url = 3 [(buf.validate.field).string.uri = true];
string url = 3 [
(buf.validate.field).ignore = IGNORE_IF_UNPOPULATED,
(buf.validate.field).string.uri = true
];
}
}
5 changes: 4 additions & 1 deletion buf/plugin/info/v1/plugin_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ message PluginInfo {
// The url for the plugin.
//
// This typically is the source control repository that contains the plugin's implementation.
string url = 1 [(buf.validate.field).string.uri = true];
string url = 1 [
(buf.validate.field).ignore = IGNORE_IF_UNPOPULATED,
(buf.validate.field).string.uri = true
];
// The license of the plugin.
License license = 2;
// Documentation for a plugin.
Expand Down

0 comments on commit 0b398d7

Please sign in to comment.