Skip to content

Commit 8276c1c

Browse files
authored
Merge pull request #25 from larsmaxfield/developer/lars
Resolve #22, #24
2 parents 504ab20 + fdca892 commit 8276c1c

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,19 @@ cd /root/of/this/repo
357357
conda activate ./env
358358
```
359359

360+
### How to release
361+
362+
1. Checkout branch
363+
2. Update version X.Y.Z.YYYYMMDD in `pyproject.toml`
364+
- Bump X.Y.Z according to semantic versioning 2.0.0
365+
- Set YYYYMMDD according to current UTC date
366+
4. Update `poetry.lock` with `poetry update`
367+
5. Push changes
368+
6. Merge with main
369+
7. Create release with title and tag `vX.Y.Z.YYYYMMDD` (prepend `v` in both)
370+
8. PyPI is automatically published
371+
372+
360373
### Paradigms
361374

362375
#### Use the top-level `__init__.py` to declare a 'public' API for the module

jsonschema_fill_default/jsonschema_fill_default.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def _fill_properties(instance: dict, schema: dict):
136136
if _property not in instance:
137137
instance[_property] = dict()
138138
fill_default(instance[_property], subschema)
139-
if len(instance[_property]) == 0: # No default found inside
140-
del instance[_property]
139+
if isinstance(instance[_property], (list, tuple, dict, set)):
140+
if len(instance[_property]) == 0: # No default found inside
141+
del instance[_property]
141142
if _property not in instance \
142143
and "default" in subschema:
143144
instance[_property] = subschema["default"]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "jsonschema-fill-default"
3-
version = "0.1.1.20250130"
3+
version = "0.1.2.20250130"
44
description = "Fill a JSON instance with the missing defaults from its JSON Schema Draft 2020-12-valid schema"
55
authors = ["Lars Maxfield"]
66
readme = "README.md"

tests/unit/test_validate_and_fill.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@
703703
}
704704
}
705705
]
706-
},
706+
}
707707
}
708708

709709

0 commit comments

Comments
 (0)