Skip to content

Commit e0dc454

Browse files
committed
[validation] Add ValidationID class
1 parent db1a8cf commit e0dc454

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

odml/validation.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,49 @@
44
"""
55

66
import re
7+
8+
from enum import Enum
9+
710
from . import dtypes
811

912
LABEL_ERROR = 'error'
1013
LABEL_WARNING = 'warning'
1114

1215

16+
class ValidationID(Enum):
17+
"""
18+
IDs identifying registered validation handlers.
19+
"""
20+
unspecified = 1
21+
22+
# Required attributes validations
23+
object_required_attributes = 10
24+
section_type_must_be_defined = 11
25+
26+
# Unique id, name and type validations
27+
section_unique_ids = 20
28+
property_unique_ids = 21
29+
section_unique_name_type = 22
30+
property_unique_name = 23
31+
32+
# Good form validations
33+
object_name_readable = 30
34+
35+
# Property specific validations
36+
property_terminology_check = 40
37+
property_dependency_check = 41
38+
property_values_check = 42
39+
property_values_string_check = 43
40+
41+
# Cardinality validations
42+
section_properties_cardinality = 50
43+
section_sections_cardinality = 51
44+
property_values_cardinality = 52
45+
46+
# Optional validations
47+
section_repository_present = 60
48+
49+
1350
class ValidationError(object):
1451
"""
1552
Represents an error found in the validation process.

0 commit comments

Comments
 (0)