Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1''' 

2Created on May 11, 2020 

3@author: Andrew Habib 

4''' 

5 

6 

7class _Error(Exception): 

8 pass 

9 

10 

11class UnsupportedRecursiveRef(_Error): 

12 def __init__(self, schema, which_side): 

13 self.schema = schema 

14 self.which_side = which_side 

15 

16 def __str__(self): 

17 return f'Recursive schemas are not supported. {self.which_side} is recursive.' 

18 

19 

20class UnsupportedEnumCanonicalization(_Error): 

21 

22 def __init__(self, tau, schema): 

23 self.tau = tau 

24 self.schema = schema 

25 

26 

27 def __str__(self): 

28 return f'Canonicalizing an enum schema of type {self.tau} is not supported.' 

29 

30 

31# class UnsupportedSchemaType(_Error): 

32# ''' 

33# Probably this is not required since custom types are not 

34# supported by jsonschema validation anyways; so we will not reat 

35# a case that uses this exception.''' 

36 

37# def __init__(self, schema, tau): 

38# self.schema = schema 

39# self.tau = tau 

40 

41# def __str__(self): 

42# return '{} is unsupported jsonschema type in schema: {}'.format(self.tau, self.schema) 

43 

44 

45# class UnsupportedSubtypeChecker(_Error): 

46 

47# def __init__(self, schema, desc): 

48# self.schema = schema 

49# self.desc = desc 

50 

51# def __str__(self): 

52# return '{} is unsupported. Schema: {}'.format(self.desc, self.schema)