Skip to content

Commit

Permalink
json schema fix (#279)
Browse files Browse the repository at this point in the history
* json schema fix
 Please enter the commit message for your changes. Lines starting

* version

---------

Co-authored-by: Alzbeta Pokorna <[email protected]>
  • Loading branch information
Alzpeta and Alzbeta Pokorna authored Nov 22, 2024
1 parent 26e953c commit 633cac4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion oarepo_model_builder/datatypes/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class DataType(AbstractDataType):
class ModelSchema(ma.Schema):
type = fields.String(required=True)
required = fields.Bool()
jsonschema = fields.Nested(PermissiveSchema)
json_schema = fields.Nested(PermissiveSchema, attribute="json-schema", data_key="json-schema")
mapping = fields.Nested(PermissiveSchema)
id = fields.String(
metadata={
Expand Down
4 changes: 3 additions & 1 deletion oarepo_model_builder/utils/deepmerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ def deepmerge(
)
elif isinstance(target, list):
if source is not None:
if not isinstance(source, list):
if isinstance(source, dict):
raise AttributeError(
f"Incompatible source and target on path {stack}: source {source}, target {target}"
)
if not isinstance(source, list):
return target
if listmerge == "overwrite":
for idx in range(min(len(source), len(target))):
target[idx] = deepmerge(
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-model-builder
version = 4.0.94
version = 4.0.95
description = A utility library that generates OARepo required data model files from a JSON specification file
authors = Miroslav Bauer <[email protected]>, Miroslav Simek <[email protected]>
readme = README.md
Expand Down

0 comments on commit 633cac4

Please sign in to comment.