diff --git a/src/edr_pydantic/collections.py b/src/edr_pydantic/collections.py index f32a347..8525454 100644 --- a/src/edr_pydantic/collections.py +++ b/src/edr_pydantic/collections.py @@ -2,7 +2,6 @@ from typing import List from typing import Optional -from .data_queries import CollectionDataQueries from .data_queries import DataQueries from .extent import Extent from .link import Link @@ -17,7 +16,7 @@ class Collection(EDRBaseModel): keywords: Optional[List[str]] = None links: List[Link] extent: Extent - data_queries: Optional[CollectionDataQueries] = None + data_queries: Optional[DataQueries] = None # TODO According to req A.13 it should be CRSDetails object crs: Optional[List[str]] = None output_formats: Optional[List[str]] = None @@ -26,16 +25,16 @@ class Collection(EDRBaseModel): distanceunits: Optional[List[str]] = None -class CollectionsModel(EDRBaseModel): +class Collections(EDRBaseModel): links: List[Link] collections: List[Collection] # For now, the instance metadata corresponds to the first collection metadata. So they have equal classes class Instance(Collection): - data_queries: Optional[DataQueries] = None + pass -class InstancesModel(EDRBaseModel): +class Instances(EDRBaseModel): links: List[Link] instances: List[Instance] diff --git a/src/edr_pydantic/data_queries.py b/src/edr_pydantic/data_queries.py index 8d8791f..18ed305 100644 --- a/src/edr_pydantic/data_queries.py +++ b/src/edr_pydantic/data_queries.py @@ -18,6 +18,8 @@ class DataQueries(EDRBaseModel): # TODO Difference object/req: item, location? locations: Optional[EDRQuery] = None items: Optional[EDRQuery] = None + # TODO ticket maken en maken voor separation + instances: Optional[EDRQuery] = None class CollectionDataQueries(DataQueries): diff --git a/tests/test_edr.py b/tests/test_edr.py index c924f2d..f1fc92e 100644 --- a/tests/test_edr.py +++ b/tests/test_edr.py @@ -2,13 +2,13 @@ from pathlib import Path import pytest -from edr_pydantic.collections import CollectionsModel +from edr_pydantic.collections import Collections from pydantic import ValidationError happy_cases = [ - ("knmi-example-collection.json", CollectionsModel), - ("doc-example-collection.json", CollectionsModel), + ("knmi-example-collection.json", Collections), + ("doc-example-collection.json", Collections), ]