mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
In Java, it seems like the existing behavior is that we allow
single-element arrays to be parsed into a non-repeated field.
In `public final class JsonArray extends JsonElement implements Iterable<JsonElement>`:
```
@Override
public String getAsString() {
return getAsSingleElement().getAsString();
}
```
TBH I don't know if this behavior is necessarily _desired_, but here is
a unit test to validate this behavior so that we don't accidentally
break it without intending to.
PiperOrigin-RevId: 947320631
|
||
|---|---|---|
| .. | ||
| src | ||
| BUILD.bazel | ||
| pom_template.xml | ||