getItem method

JsonSchema4 getItem(
  1. List<String> parts,
  2. JsonSchema4 schema
)

Implementation

JsonSchema4 getItem(List<String> parts, JsonSchema4 schema) {
  JsonSchema4? item = schema.properties?[parts[1]];
  if (item == null) return JsonSchema4();
  if (item.type == PropertyType.object.name && parts.length > 2) {
    parts.removeRange(0, 2);
    return getItem(parts, item);
  }
  return item;
}