Skip to content

Commit

Permalink
[#8] making some fields of CoreMetadata as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Jun 20, 2024
1 parent 4e02b1e commit 1183e82
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions hsextract/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,16 @@ class TemporalCoverage(SchemaBaseModel):
title="Start date",
description="A date/time object containing the instant corresponding to the commencement of the time "
"interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM).",
# TODO: these are failing due to a problem with transpiled dependencies inside cznet-vue-core
# formatMaximum={"$data": "1/endDate"},
# errorMessage= { "formatMaximum": "must be lesser than or equal to End date" }
formatMaximum={"$data": "1/endDate"},
errorMessage={"formatMaximum": "must be lesser than or equal to End date"}
)
endDate: Optional[datetime] = Field(
title="End date",
description="A date/time object containing the instant corresponding to the termination of the time "
"interval (ISO8601 formatted date - YYYY-MM-DDTHH:MM). If the ending date is left off, "
"that means the temporal coverage is ongoing.",
# formatMinimum={"$data": "1/startDate"},
# errorMessage= { "formatMinimum": "must be greater than or equal to Start date" }
formatMinimum={"$data": "1/startDate"},
errorMessage={"formatMinimum": "must be greater than or equal to Start date"}
)


Expand Down Expand Up @@ -462,13 +461,13 @@ class CoreMetadata(SchemaBaseModel):
"assigned by a repository. Multiple identifiers can be entered. Where identifiers can be "
"encoded as URLs, enter URLs here.",
)
creator: List[Union[Creator, Organization]] = Field(description="Person or Organization that created the resource.")
dateCreated: datetime = Field(title="Date created", description="The date on which the resource was created.")
keywords: List[str] = Field(
creator: Optional[List[Union[Creator, Organization]]] = Field(description="Person or Organization that created the resource.")
dateCreated: Optional[datetime] = Field(title="Date created", description="The date on which the resource was created.")
keywords: Optional[List[str]] = Field(
min_items=1, description="Keywords or tags used to describe the dataset, delimited by commas."
)
license: License = Field(description="A license document that applies to the resource.")
provider: Union[Organization, Provider] = Field(
license: Optional[License] = Field(description="A license document that applies to the resource.")
provider: Optional[Union[Organization, Provider]] = Field(
description="The repository, service provider, organization, person, or service performer that provides"
" access to the resource."
)
Expand Down

0 comments on commit 1183e82

Please sign in to comment.