{"type": "object", "allOf": [{"if": {"required": ["connectionType"], "properties": {"connectionType": {"const": "Metered"}}}, "then": {"required": ["slabs"], "properties": {"calculationAttribute": {"enum": ["Water consumption"]}}}}, {"if": {"required": ["connectionType"], "properties": {"connectionType": {"const": "Non_Metered"}}}, "then": {"properties": {"calculationAttribute": {"enum": ["Flat", "No. of taps", "Pipe Size"]}}}}], "title": "Generated schema for Root", "$schema": "http://json-schema.org/draft-07/schema#", "required": ["buildingType", "calculationAttribute", "connectionType", "minimumCharge"], "x-unique": ["buildingType", "connectionType"], "properties": {"slabs": {"type": "array", "items": {"type": "object", "required": ["from", "to", "charge"], "properties": {"to": {"type": "number"}, "from": {"type": "number"}, "charge": {"type": "number"}, "meterCharge": {"type": "number"}}}}, "buildingType": {"enum": ["RESIDENTIAL", "NONRESIDENTIAL", "COMMERCIAL AND GOVERNMENT", "PARTLY COMMERCIAL", "COMMERCIAL", "GOVERNMENT", "MIXED", "PUBLICSECTOR"], "type": "string"}, "minimumCharge": {"type": "number"}, "connectionType": {"enum": ["Metered", "Non_Metered"], "type": "string"}, "calculationAttribute": {"enum": ["Flat", "Water consumption", "No. of taps", "Pipe Size"], "type": "string"}}}