Skip to content

Commit

Permalink
Allow class as a keyword, but ignore it, to allow validating against …
Browse files Browse the repository at this point in the history
…schemas which include it.
  • Loading branch information
cswindle authored and Grokzen committed Mar 13, 2018
1 parent cef0c05 commit 9df9d64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pykwalify/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def keywords(self):
('allowempty_map', 'allowempty_map'),
('assertion', 'assertion'),
('default', 'default'),
('class', 'class'),
('desc', 'desc'),
('enum', 'enum'),
('example', 'example'),
Expand Down Expand Up @@ -409,6 +410,7 @@ def init(self, schema, path):
func_mapping = {
"allowempty": self.init_allow_empty_map,
"assert": self.init_assert_value,
"class": lambda x, y, z: (),
"default": self.init_default_value,
"desc": self.init_desc_value,
"enum": self.init_enum_value,
Expand Down Expand Up @@ -1212,6 +1214,7 @@ def check_type_keywords(self, schema, rule, path):
All supported keywords:
- allowempty_map
- assertion
- class
- date
- default
- desc
Expand Down Expand Up @@ -1249,7 +1252,7 @@ def check_type_keywords(self, schema, rule, path):
'float': global_keywords + ['default', 'enum', 'range', 'required'],
'number': global_keywords + ['default', 'enum'],
'bool': global_keywords + ['default', 'enum'],
'map': global_keywords + ['allowempty_map', 'mapping', 'map', 'allowempty', 'required', 'matching-rule', 'range'],
'map': global_keywords + ['allowempty_map', 'mapping', 'map', 'allowempty', 'required', 'matching-rule', 'range', 'class'],
'seq': global_keywords + ['sequence', 'seq', 'required', 'range', 'matching'],
'sequence': global_keywords + ['sequence', 'seq', 'required'],
'mapping': global_keywords + ['mapping', 'seq', 'required'],
Expand Down

0 comments on commit 9df9d64

Please sign in to comment.