diff --git a/src/edr_pydantic/parameter.py b/src/edr_pydantic/parameter.py index c2a31f7..8102c59 100644 --- a/src/edr_pydantic/parameter.py +++ b/src/edr_pydantic/parameter.py @@ -15,9 +15,7 @@ class MeasurementType(EdrBaseModel): method: str # TODO: Add validation of ISO 8601 duration (including leading minus sign) - # TODO: Confusion in spec on the field name, duration versus period. - # See https://github.com/opengeospatial/ogcapi-environmental-data-retrieval/issues/560 - period: str + duration: str class Parameter(EdrBaseModel, extra="allow"): diff --git a/tests/test_data/doc-example-collections.json b/tests/test_data/doc-example-collections.json index 2864abb..fee708e 100644 --- a/tests/test_data/doc-example-collections.json +++ b/tests/test_data/doc-example-collections.json @@ -198,7 +198,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Speed": { @@ -217,7 +217,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Gust": { @@ -236,7 +236,7 @@ }, "measurementType": { "method": "maximum", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Air Temperature": { @@ -255,7 +255,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Weather": { @@ -274,7 +274,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Relative Humidity": { @@ -293,7 +293,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Dew point": { @@ -312,7 +312,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Pressure": { @@ -331,7 +331,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Pressure Tendancy": { @@ -350,7 +350,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Visibility": { @@ -369,7 +369,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } } } @@ -539,7 +539,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Speed": { @@ -558,7 +558,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Gust": { @@ -577,7 +577,7 @@ }, "measurementType": { "method": "maximum", - "period": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Air Temperature": { @@ -596,7 +596,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Weather": { @@ -615,7 +615,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Relative Humidity": { @@ -634,7 +634,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Feels like temperature": { @@ -653,7 +653,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "UV index": { @@ -672,7 +672,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Probability of precipitation": { @@ -691,7 +691,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Visibility": { @@ -710,7 +710,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } } } diff --git a/tests/test_data/parameter-names.json b/tests/test_data/parameter-names.json index 1583484..3ce8b0f 100644 --- a/tests/test_data/parameter-names.json +++ b/tests/test_data/parameter-names.json @@ -15,7 +15,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } }, "u-component_of_wind_altitude_above_msl": { @@ -34,7 +34,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } }, "v-component_of_wind_altitude_above_msl": { @@ -53,7 +53,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } } } diff --git a/tests/test_data/parameter-with-extent.json b/tests/test_data/parameter-with-extent.json index ad521ec..e247a9a 100644 --- a/tests/test_data/parameter-with-extent.json +++ b/tests/test_data/parameter-with-extent.json @@ -39,6 +39,6 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } }