PySerials 0.0.0.dev24__py3-none-any.whl → 0.0.0.dev25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySerials
3
- Version: 0.0.0.dev24
3
+ Version: 0.0.0.dev25
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: jsonschema <5,>=4.21.0
6
6
  Requires-Dist: referencing >=0.35.1
@@ -8,7 +8,7 @@ Requires-Dist: jsonpath-ng <2,>=1.6.1
8
8
  Requires-Dist: ruamel.yaml <0.18,>=0.17.32
9
9
  Requires-Dist: ruamel.yaml.string <1,>=0.1.1
10
10
  Requires-Dist: tomlkit <0.12,>=0.11.8
11
- Requires-Dist: MDit ==0.0.0.dev21
12
- Requires-Dist: ExceptionMan ==0.0.0.dev21
11
+ Requires-Dist: MDit ==0.0.0.dev22
12
+ Requires-Dist: ExceptionMan ==0.0.0.dev22
13
13
  Requires-Dist: ProtocolMan ==0.0.0.dev2
14
14
 
@@ -4,14 +4,14 @@ pyserials/format.py,sha256=dTukpab6WHSyVRQ9SteY5fhr3GFjWFboEl-1cw_udVY,1729
4
4
  pyserials/nested_dict.py,sha256=8cPs4LykXh4stFpaLINPjrAeSyaOyyTdhg0FZZ2YOYA,3361
5
5
  pyserials/read.py,sha256=uucYQH1V4GStwRgRZ2eQIXkH4ukB5qz0EA885grwi68,6592
6
6
  pyserials/update.py,sha256=GfrFgc1a2qYqR8zs04cngVKcXE0124o20xiJQiSMIxg,9259
7
- pyserials/validate.py,sha256=Ocs0x0BAV9zwRCgg_J5BGU2kEZV6vVjfDBsR3M9Teus,3564
7
+ pyserials/validate.py,sha256=ti0D_yLzB_HELvf1d5qrarx1Ac-opBMN1Xh5lADRAQU,3664
8
8
  pyserials/write.py,sha256=pN8w78qVsKJjZd_jvPUcZjYp_RJkP7uQzpiXvPOv4lM,1776
9
9
  pyserials/exception/__init__.py,sha256=ZhbggwJUMlTyBhifAivC8ZQxP1Na6lJAwzZs7_YjOSU,151
10
10
  pyserials/exception/_base.py,sha256=IdaZwBPBYgiUaWnvN0eMXvQQBqLbN1t766034CK7Hlc,853
11
11
  pyserials/exception/read.py,sha256=QyG6ulExXH9u8oDRjUfter70SMDVQqL4nig5s-JzWN4,9252
12
12
  pyserials/exception/update.py,sha256=P0js2-iY2fgO_KLdqedgWE3TTS5Xz15cusZY_wuKIW4,4222
13
13
  pyserials/exception/validate.py,sha256=7UkQEEqCa8HJ20gpTFnLDhT3P5OPLD2oD9fUK2Jcuns,7466
14
- PySerials-0.0.0.dev24.dist-info/METADATA,sha256=QaB38VIehn0r9lf6n7KY1T_1UJQzqs4ljA_PafPUn-Y,438
15
- PySerials-0.0.0.dev24.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
16
- PySerials-0.0.0.dev24.dist-info/top_level.txt,sha256=SAks7WjSjdkv3i9Hvt4gY_P7VQbhhYJN5mf5dqx1aao,10
17
- PySerials-0.0.0.dev24.dist-info/RECORD,,
14
+ PySerials-0.0.0.dev25.dist-info/METADATA,sha256=AED-NAQT-ry8tShp2z2FomxoGwIx6TG6IQ09Y0lehJ8,438
15
+ PySerials-0.0.0.dev25.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
16
+ PySerials-0.0.0.dev25.dist-info/top_level.txt,sha256=SAks7WjSjdkv3i9Hvt4gY_P7VQbhhYJN5mf5dqx1aao,10
17
+ PySerials-0.0.0.dev25.dist-info/RECORD,,
pyserials/validate.py CHANGED
@@ -49,9 +49,10 @@ def jsonschema(
49
49
  validate_properties = validator_class.VALIDATORS["properties"]
50
50
 
51
51
  def set_defaults(validator, properties, instance, schema):
52
- for property, subschema in properties.items():
53
- if "default" in subschema:
54
- instance.setdefault(property, subschema["default"])
52
+ if isinstance(instance, dict): # The entire dict instance may be templated
53
+ for property, subschema in properties.items():
54
+ if "default" in subschema:
55
+ instance.setdefault(property, subschema["default"])
55
56
 
56
57
  for error in validate_properties(
57
58
  validator,