Support nested annotation syntax
See original GitHub issueDescribe the bug I am using https://github.com/envoyproxy/protoc-gen-validate to generate validators for my protobuf using annotations.
Both of the following are valid syntax and compiles properly, but is considered to be invalid by the protobuf plugin:
Formatted by https://github.com/uber/prototool
message SomeMessage {
repeated string ids = 1 [
(validate.rules).repeated = {
items: {
string: {
len: 36
}
}
min_items: 1
}
];
}
In a single line:
message SomeMessage {
repeated string ids = 1 [(validate.rules).repeated = {items {string {len: 36}}, min_items: 1}];
}
To Reproduce Steps to reproduce the behavior:
- Paste the above snippets into the editor and see errors being highlighted.
Expected behavior The above snippets are valid and should not be considered errors
Screenshots
Plugin (please complete the following information):
- OS: Windows 10 May Update
- Plugin version: v0.13.0
- IDE: GoLand 2019.1.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:9
Top Results From Across the Web
java - Understanding structure / syntax of nested annotations
There are four annotations at play in your sample code: @NamedQueries + @NamedQuery and @NamedNativeQueries + @NamedNativeQuery .
Read more >add support for nested java annotations · Issue #294 · scala/bug
In this example, the nested annotation is in an array value, but they should also be supported as single values:
Read more >JUnit 5 Nested Class: @Nested Tutorial With Examples
@Nested annotation is used on a class and not on a specific test. An outermost class can never be annotated with @Nested. It...
Read more >JUnit 5 User Guide
Denotes that the annotated class is a non-static nested test class. On Java 8 through Java 15, @BeforeAll and @AfterAll methods cannot be...
Read more >Repeating Annotations - The Java Tutorials
It is now possible to use an annotation zero times, once, or, if the annotation's type is marked as @Repeatable , more than...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Shameless plug for anyone that needs to use the types of long-form options described in this issue: https://plugins.jetbrains.com/plugin/14004
Yeah. This part of the proto language isn’t well-specified, but
protoc
just defers to the text format parser for these long form options (relevant code indescriptor.cc
).