@@ -239,14 +239,19 @@ def canonicalize_not(d):
239
239
allofs .append (canonicalize_not ({"not" : i }))
240
240
return {"allOf" : allofs }
241
241
242
+ # Should not reach here. Should be canonicalized and
243
+ # simplified by now.
242
244
elif c == "allOf" :
243
- anyofs = []
244
- for i in negated_schema ["allOf" ]:
245
- anyofs .append (canonicalize_not ({"not" : i }))
246
- return {"anyOf" : anyofs }
247
-
248
- elif c == "oneOf" :
249
- return canonicalize_not ({"not" : canonicalize_connectors (negated_schema )})
245
+ # anyofs = []
246
+ # for i in negated_schema["allOf"]:
247
+ # anyofs.append(canonicalize_not({"not": i}))
248
+ # return {"anyOf": anyofs}
249
+ return canonicalize_not ({'not' : canonicalize_connectors (negated_schema )})
250
+
251
+ # anyofs.append(canonicalize_not({"not": i}))
252
+ # Should not reach here. Should be canonicalized by now.
253
+ # elif c == "oneOf":
254
+ # return canonicalize_not({"not": canonicalize_connectors(negated_schema)})
250
255
else :
251
256
sys .exit (">>>>>> Ewwwww! Shouldn't be here during canonicalization. <<<<<<" )
252
257
@@ -296,7 +301,8 @@ def rewrite_enum(d):
296
301
297
302
# Unsupported cases of rewriting enums
298
303
elif t == 'array' or t == 'object' :
299
- raise UnexpectedCanonicalization (msg = 'Rewriting the following enum is not supported.' , tau = t , schema = d )
304
+ raise UnexpectedCanonicalization (
305
+ msg = 'Rewriting the following enum is not supported.' , tau = t , schema = d )
300
306
301
307
302
308
def simplify_schema_and_embed_checkers (s ):
0 commit comments