Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/overture-schema-codegen/changelog.d/633.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated scaffold test expectations for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ def test_array_nested_field_builds_path(self, connector_spec: ModelSpec) -> None
assert isinstance(scaffold["sources"], list)
assert len(scaffold["sources"]) == 1
elem = scaffold["sources"][0]
# Required sibling 'dataset' populated
assert "dataset" in elem
# Required sibling 'property' populated; optional 'dataset' omitted
assert "property" in elem
assert "dataset" not in elem

def test_scaffold_is_dict(self, connector_spec: ModelSpec) -> None:
field_nodes, _ = build_checks(connector_spec)
Expand Down
1 change: 1 addition & 0 deletions packages/overture-schema-common/changelog.d/633.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Made `sources[].dataset` optional; sources entries no longer require a `dataset` value.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ class SourceItem(BaseModel):
it applies to the feature geometry.
""").strip()
)
dataset: str = Field(
description=textwrap.dedent("""
Name of the dataset where the source data can be found.
""").strip()
)

# Optional

dataset: Annotated[
str | None,
Field(
description=textwrap.dedent("""
Name of the dataset where the source data can be found.
""").strip()
),
] = None
license: Annotated[
StrippedString | None,
Field(
Expand Down
2 changes: 1 addition & 1 deletion packages/overture-schema-common/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_feature_json_schema() -> None:
},
"confidence": {"maximum": 1.0, "minimum": 0.0, "type": "number"},
},
"required": ["property", "dataset"],
"required": ["property"],
"type": "object",
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Regenerated baseline schemas for optional `sources[].dataset`.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,7 @@
}
},
"required": [
"property",
"dataset"
"property"
],
"title": "SourceItem",
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion schema/defs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ description: Common schema definitions shared by all themes
Additional metadata such as license, record_id, update_time, and
confidence may also be provided.
type: object
required: [property, dataset]
required: [property]
allOf:
- { "$ref": "#/$defs/propertyContainers/geometricRangeScopeContainer" }
unevaluatedProperties: false
Expand Down
Loading