'Nested structured search is Sourcegraph?
I would like to search Java annotations with another annotations inside. I don't know how many nested levels there are or I don't want to specify it. Finally, I would like to search for examples of @ApiImplicitParams
with param type body
and with @Example
annotations inside.
But first I am trying to match anything nested.
First I searched for
@ApiImplicitParams(...)
and it found me somethind. The very first result is
@ApiImplicitParams({ @ApiImplicitParam(name = "foo", value = "List of strings", paramType = "body", dataType = "Foo") })
and has @ApiImplicitParam
inside. Let's try to match it.
I tried
@ApiImplicitParams({@ApiImplicitParam(...) ...})
but it didn't find that case with one nesting and didn't find any cases with multiple @ApiImplicitParams
inside.
How to accomplish?
Solution 1:[1]
Finally, I would like to search for examples of @ApiImplicitParams with param type body and with @Example annotations inside.
I believe the following query will meet your requirements here.
@ApiImplicitParams({...@ApiImplicitParam(...paramType = "body"...)...}) lang:Java
Some examples of matches --
@ResponseBody
@ApiImplicitParams({ @ApiImplicitParam(name = "foo", value = "List of strings", paramType = "body", dataType = "Foo") })
public Foo create(@RequestBody final Foo foo) {
nickname = "setLoggingSettings")
@ApiImplicitParams({
@ApiImplicitParam(
name = "Logging Config",
value = "Logging config to be updated",
required = true,
dataType = "com.yugabyte.yw.forms.PlatformLoggingConfig",
paramType = "body")
})
public Result setLoggingSettings() throws JoranException {
A note on this --
I don't know how many nested levels there are or I don't want to specify it.
The query provided above assumes one nested block, I'm afraid right now Sourcegraph doesn't have a good way to express an arbitrary level of nesting.
Hope that helps!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Warren Gifford |