@@ -219,22 +219,22 @@ async def bind_schema_async(
219
219
json_schema_version = response .get ("jsonSchemaVersionInfo" , {})
220
220
return JSONSchemaBinding (
221
221
json_schema_version_info = JSONSchemaVersionInfo (
222
- organization_id = json_schema_version .get ("organizationId" , "" ),
223
- organization_name = json_schema_version .get ("organizationName" , "" ),
224
- schema_id = json_schema_version .get ("schemaId" , "" ),
225
- id = json_schema_version .get ("$id" , "" ),
226
- schema_name = json_schema_version .get ("schemaName" , "" ),
227
- version_id = json_schema_version .get ("versionId" , "" ),
228
- semantic_version = json_schema_version .get ("semanticVersion" , "" ),
229
- json_sha256_hex = json_schema_version .get ("jsonSHA256Hex" , "" ),
230
- created_on = json_schema_version .get ("createdOn" , "" ),
231
- created_by = json_schema_version .get ("createdBy" , "" ),
222
+ organization_id = json_schema_version .get ("organizationId" , None ),
223
+ organization_name = json_schema_version .get ("organizationName" , None ),
224
+ schema_id = json_schema_version .get ("schemaId" , None ),
225
+ id = json_schema_version .get ("$id" , None ),
226
+ schema_name = json_schema_version .get ("schemaName" , None ),
227
+ version_id = json_schema_version .get ("versionId" , None ),
228
+ semantic_version = json_schema_version .get ("semanticVersion" , None ),
229
+ json_sha256_hex = json_schema_version .get ("jsonSHA256Hex" , None ),
230
+ created_on = json_schema_version .get ("createdOn" , None ),
231
+ created_by = json_schema_version .get ("createdBy" , None ),
232
232
),
233
- object_id = response .get ("objectId" , "" ),
234
- object_type = response .get ("objectType" , "" ),
235
- created_on = response .get ("createdOn" , "" ),
236
- created_by = response .get ("createdBy" , "" ),
237
- enable_derived_annotations = response .get ("enableDerivedAnnotations" , False ),
233
+ object_id = response .get ("objectId" , None ),
234
+ object_type = response .get ("objectType" , None ),
235
+ created_on = response .get ("createdOn" , None ),
236
+ created_by = response .get ("createdBy" , None ),
237
+ enable_derived_annotations = response .get ("enableDerivedAnnotations" , None ),
238
238
)
239
239
240
240
async def get_schema_async (
@@ -256,22 +256,24 @@ async def get_schema_async(
256
256
json_schema_version_info = response .get ("jsonSchemaVersionInfo" , {})
257
257
return JSONSchemaBinding (
258
258
json_schema_version_info = JSONSchemaVersionInfo (
259
- organization_id = json_schema_version_info .get ("organizationId" , "" ),
260
- organization_name = json_schema_version_info .get ("organizationName" , "" ),
261
- schema_id = json_schema_version_info .get ("schemaId" , "" ),
262
- id = json_schema_version_info .get ("$id" , "" ),
263
- schema_name = json_schema_version_info .get ("schemaName" , "" ),
264
- version_id = json_schema_version_info .get ("versionId" , "" ),
265
- semantic_version = json_schema_version_info .get ("semanticVersion" , "" ),
266
- json_sha256_hex = json_schema_version_info .get ("jsonSHA256Hex" , "" ),
267
- created_on = json_schema_version_info .get ("createdOn" , "" ),
268
- created_by = json_schema_version_info .get ("createdBy" , "" ),
259
+ organization_id = json_schema_version_info .get ("organizationId" , None ),
260
+ organization_name = json_schema_version_info .get (
261
+ "organizationName" , None
262
+ ),
263
+ schema_id = json_schema_version_info .get ("schemaId" , None ),
264
+ id = json_schema_version_info .get ("$id" , None ),
265
+ schema_name = json_schema_version_info .get ("schemaName" , None ),
266
+ version_id = json_schema_version_info .get ("versionId" , None ),
267
+ semantic_version = json_schema_version_info .get ("semanticVersion" , None ),
268
+ json_sha256_hex = json_schema_version_info .get ("jsonSHA256Hex" , None ),
269
+ created_on = json_schema_version_info .get ("createdOn" , None ),
270
+ created_by = json_schema_version_info .get ("createdBy" , None ),
269
271
),
270
- object_id = response .get ("objectId" , "" ),
271
- object_type = response .get ("objectType" , "" ),
272
- created_on = response .get ("createdOn" , "" ),
273
- created_by = response .get ("createdBy" , "" ),
274
- enable_derived_annotations = response .get ("enableDerivedAnnotations" , False ),
272
+ object_id = response .get ("objectId" , None ),
273
+ object_type = response .get ("objectType" , None ),
274
+ created_on = response .get ("createdOn" , None ),
275
+ created_by = response .get ("createdBy" , None ),
276
+ enable_derived_annotations = response .get ("enableDerivedAnnotations" , None ),
275
277
)
276
278
277
279
async def delete_schema_async (
@@ -307,37 +309,39 @@ async def validate_schema_async(
307
309
if "validationException" in response :
308
310
return InvalidJSONSchemaValidation (
309
311
validation_response = JSONSchemaValidation (
310
- object_id = response .get ("objectId" , "" ),
311
- object_type = response .get ("objectType" , "" ),
312
- object_etag = response .get ("objectEtag" , "" ),
313
- id = response .get ("schema$id" , "" ),
314
- is_valid = response .get ("isValid" , False ),
315
- validated_on = response .get ("validatedOn" , "" ),
312
+ object_id = response .get ("objectId" , None ),
313
+ object_type = response .get ("objectType" , None ),
314
+ object_etag = response .get ("objectEtag" , None ),
315
+ id = response .get ("schema$id" , None ),
316
+ is_valid = response .get ("isValid" , None ),
317
+ validated_on = response .get ("validatedOn" , None ),
316
318
),
317
- validation_error_message = response .get ("validationErrorMessage" , "" ),
319
+ validation_error_message = response .get ("validationErrorMessage" , None ),
318
320
all_validation_messages = response .get ("allValidationMessages" , []),
319
321
validation_exception = ValidationException (
320
322
pointer_to_violation = response .get ("validationException" , {}).get (
321
- "pointerToViolation" , ""
323
+ "pointerToViolation" , None
324
+ ),
325
+ message = response .get ("validationException" , {}).get (
326
+ "message" , None
322
327
),
323
- message = response .get ("validationException" , {}).get ("message" , "" ),
324
328
schema_location = response .get ("validationException" , {}).get (
325
- "schemaLocation" , ""
329
+ "schemaLocation" , None
326
330
),
327
331
causing_exceptions = [
328
332
CausingException (
329
- keyword = ce .get ("keyword" , "" ),
330
- pointer_to_violation = ce .get ("pointerToViolation" , "" ),
331
- message = ce .get ("message" , "" ),
332
- schema_location = ce .get ("schemaLocation" , "" ),
333
+ keyword = ce .get ("keyword" , None ),
334
+ pointer_to_violation = ce .get ("pointerToViolation" , None ),
335
+ message = ce .get ("message" , None ),
336
+ schema_location = ce .get ("schemaLocation" , None ),
333
337
causing_exceptions = [
334
338
CausingException (
335
- keyword = nce .get ("keyword" , "" ),
339
+ keyword = nce .get ("keyword" , None ),
336
340
pointer_to_violation = nce .get (
337
- "pointerToViolation" , ""
341
+ "pointerToViolation" , None
338
342
),
339
- message = nce .get ("message" , "" ),
340
- schema_location = nce .get ("schemaLocation" , "" ),
343
+ message = nce .get ("message" , None ),
344
+ schema_location = nce .get ("schemaLocation" , None ),
341
345
)
342
346
for nce in ce .get ("causingExceptions" , [])
343
347
],
@@ -349,12 +353,12 @@ async def validate_schema_async(
349
353
),
350
354
)
351
355
return JSONSchemaValidation (
352
- object_id = response .get ("objectId" , "" ),
353
- object_type = response .get ("objectType" , "" ),
354
- object_etag = response .get ("objectEtag" , "" ),
355
- id = response .get ("schema$id" , "" ),
356
- is_valid = response .get ("isValid" , "" ),
357
- validated_on = response .get ("validatedOn" , "" ),
356
+ object_id = response .get ("objectId" , None ),
357
+ object_type = response .get ("objectType" , None ),
358
+ object_etag = response .get ("objectEtag" , None ),
359
+ id = response .get ("schema$id" , None ),
360
+ is_valid = response .get ("isValid" , None ),
361
+ validated_on = response .get ("validatedOn" , None ),
358
362
)
359
363
360
364
async def get_schema_derived_keys_async (
@@ -428,37 +432,37 @@ async def get_invalid_validation_async(
428
432
async for item in gen :
429
433
yield InvalidJSONSchemaValidation (
430
434
validation_response = JSONSchemaValidation (
431
- object_id = item .get ("objectId" , "" ),
432
- object_type = item .get ("objectType" , "" ),
433
- object_etag = item .get ("objectEtag" , "" ),
434
- id = item .get ("schema$id" , "" ),
435
- is_valid = item .get ("isValid" , "" ),
436
- validated_on = item .get ("validatedOn" , "" ),
435
+ object_id = item .get ("objectId" , None ),
436
+ object_type = item .get ("objectType" , None ),
437
+ object_etag = item .get ("objectEtag" , None ),
438
+ id = item .get ("schema$id" , None ),
439
+ is_valid = item .get ("isValid" , None ),
440
+ validated_on = item .get ("validatedOn" , None ),
437
441
),
438
- validation_error_message = item .get ("validationErrorMessage" , "" ),
442
+ validation_error_message = item .get ("validationErrorMessage" , None ),
439
443
all_validation_messages = item .get ("allValidationMessages" , []),
440
444
validation_exception = ValidationException (
441
445
pointer_to_violation = item .get ("validationException" , {}).get (
442
- "pointerToViolation" , ""
446
+ "pointerToViolation" , None
443
447
),
444
- message = item .get ("validationException" , {}).get ("message" , "" ),
448
+ message = item .get ("validationException" , {}).get ("message" , None ),
445
449
schema_location = item .get ("validationException" , {}).get (
446
- "schemaLocation" , ""
450
+ "schemaLocation" , None
447
451
),
448
452
causing_exceptions = [
449
453
CausingException (
450
- keyword = ce .get ("keyword" , "" ),
451
- pointer_to_violation = ce .get ("pointerToViolation" , "" ),
452
- message = ce .get ("message" , "" ),
453
- schema_location = ce .get ("schemaLocation" , "" ),
454
+ keyword = ce .get ("keyword" , None ),
455
+ pointer_to_violation = ce .get ("pointerToViolation" , None ),
456
+ message = ce .get ("message" , None ),
457
+ schema_location = ce .get ("schemaLocation" , None ),
454
458
causing_exceptions = [
455
459
CausingException (
456
- keyword = nce .get ("keyword" , "" ),
460
+ keyword = nce .get ("keyword" , None ),
457
461
pointer_to_violation = nce .get (
458
- "pointerToViolation" , ""
462
+ "pointerToViolation" , None
459
463
),
460
- message = nce .get ("message" , "" ),
461
- schema_location = nce .get ("schemaLocation" , "" ),
464
+ message = nce .get ("message" , None ),
465
+ schema_location = nce .get ("schemaLocation" , None ),
462
466
)
463
467
for nce in ce .get ("causingExceptions" , [])
464
468
],
0 commit comments