From 4a409fcd7cffd230450b9e2a39cbb80834815c0b Mon Sep 17 00:00:00 2001 From: mferrera Date: Thu, 19 Dec 2024 10:33:55 +0100 Subject: [PATCH] FIX: Make volumes product name required --- schema/definitions/0.8.0/schema/fmu_results.json | 4 +++- src/fmu/dataio/_model/product.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/schema/definitions/0.8.0/schema/fmu_results.json b/schema/definitions/0.8.0/schema/fmu_results.json index a37b4a4ee..35ce99019 100644 --- a/schema/definitions/0.8.0/schema/fmu_results.json +++ b/schema/definitions/0.8.0/schema/fmu_results.json @@ -3451,7 +3451,6 @@ }, "name": { "const": "inplace_volumes", - "default": "inplace_volumes", "enum": [ "inplace_volumes" ], @@ -3459,6 +3458,9 @@ "type": "string" } }, + "required": [ + "name" + ], "title": "InplaceVolumesProduct", "type": "object" }, diff --git a/src/fmu/dataio/_model/product.py b/src/fmu/dataio/_model/product.py index 98026f792..643edc918 100644 --- a/src/fmu/dataio/_model/product.py +++ b/src/fmu/dataio/_model/product.py @@ -34,7 +34,7 @@ class Product(BaseModel): name: enums.ProductName """The identifying product name for this data object.""" - file_schema: Optional[FileSchema] = None + file_schema: Optional[FileSchema] = Field(default=None) """The schema identifying the format of the product.""" @@ -45,7 +45,7 @@ class InplaceVolumesProduct(Product): This class contains metadata for the 'inplace_volumes' product. """ - name: Literal[enums.ProductName.inplace_volumes] = enums.ProductName.inplace_volumes + name: Literal[enums.ProductName.inplace_volumes] """The identifying product name for the 'inplace_volumes' product.""" file_schema: FileSchema = FileSchema(