use of com.linkedin.avroutil1.parser.exceptions.AvroSyntaxException in project avro-util by linkedin.
the class AvscParser method getOptionalString.
private Located<String> getOptionalString(JsonObjectExt node, String prop) {
JsonValueExt val = node.get(prop);
if (val == null) {
return null;
}
JsonValue.ValueType valType = val.getValueType();
if (valType != JsonValue.ValueType.STRING) {
throw new AvroSyntaxException("\"" + prop + "\" property at " + val.getStartLocation() + " is expected to be a string, not a " + JsonPUtil.describe(valType) + " (" + val + ")");
}
return new Located<>(((JsonStringExt) val).getString(), Util.convertLocation(val.getStartLocation()));
}
Aggregations