|
1 | 1 | # MIT License
|
2 | 2 | #
|
3 |
| -# Copyright (c) 2020-2022 Tskit Developers |
| 3 | +# Copyright (c) 2020-2023 Tskit Developers |
4 | 4 | #
|
5 | 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 | 6 | # of this software and associated documentation files (the "Software"), to deal
|
@@ -193,7 +193,11 @@ def binary_format_validator(validator, types, instance, schema):
|
193 | 193 | # generators of exceptions, hence the yielding
|
194 | 194 |
|
195 | 195 | # Make sure the normal type validation gets done
|
196 |
| - yield from jsonschema._validators.type(validator, types, instance, schema) |
| 196 | + try: |
| 197 | + yield from jsonschema._validators.type(validator, types, instance, schema) |
| 198 | + except AttributeError: |
| 199 | + # Needed since jsonschema==4.19.1 |
| 200 | + yield from jsonschema._keywords.type(validator, types, instance, schema) |
197 | 201 |
|
198 | 202 | # Non-composite types must have a binaryFormat
|
199 | 203 | if validator.is_type(instance, "object"):
|
@@ -222,7 +226,13 @@ def binary_format_validator(validator, types, instance, schema):
|
222 | 226 |
|
223 | 227 | def required_validator(validator, required, instance, schema):
|
224 | 228 | # Do the normal validation
|
225 |
| - yield from jsonschema._validators.required(validator, required, instance, schema) |
| 229 | + try: |
| 230 | + yield from jsonschema._validators.required( |
| 231 | + validator, required, instance, schema |
| 232 | + ) |
| 233 | + except AttributeError: |
| 234 | + # Needed since jsonschema==4.19.1 |
| 235 | + yield from jsonschema._keywords.required(validator, required, instance, schema) |
226 | 236 |
|
227 | 237 | # For struct codec if a property is not required, then it must have a default
|
228 | 238 | for prop, sub_schema in instance["properties"].items():
|
|
0 commit comments