|
5 | 5 |
|
6 | 6 | from pydantic import BaseModel, Field, field_validator, SerializeAsAny |
7 | 7 |
|
8 | | -from conSys4Py import GeometryTypes |
| 8 | +from conSys4Py.constants import GeometryTypes |
9 | 9 | from conSys4Py.datamodels.api_utils import UCUMCode, URI |
10 | 10 | from conSys4Py.datamodels.geometry import Geometry |
11 | 11 |
|
12 | 12 | """ |
13 | 13 | NOTE: The following classes are used to represent the Record Schemas that are required for use with Datastreams |
14 | 14 | The names are likely to change to include a "Schema" suffix to differentiate them from the actual data structures. |
15 | | -The current scope of the project likely excludes conversion from received data to actual SWE Common data structures, |
| 15 | +The current scope of the project likely excludes conversion from received data to actual SWE Common data structures, |
16 | 16 | in the event this is added it will most likely be in a separate module as those structures have use cases outside of |
17 | 17 | the API solely |
18 | 18 | """ |
@@ -80,10 +80,10 @@ class GeometrySchema(AnyComponentSchema): |
80 | 80 | updatable: bool = Field(False) |
81 | 81 | optional: bool = Field(False) |
82 | 82 | definition: str = Field(...) |
83 | | - constraint: dict = { |
84 | | - 'geomTypes': [GeometryTypes.POINT.value, GeometryTypes.LINESTRING.value, GeometryTypes.POLYGON.value, |
85 | | - GeometryTypes.MULTI_POINT.value, GeometryTypes.MULTI_LINESTRING.value, |
86 | | - GeometryTypes.MULTI_POLYGON.value]} |
| 83 | + constraint: dict = Field(default_factory=dict( |
| 84 | + geomTypes=[GeometryTypes.POINT.value, GeometryTypes.LINESTRING.value, GeometryTypes.POLYGON.value, |
| 85 | + GeometryTypes.MULTI_POINT.value, GeometryTypes.MULTI_LINESTRING.value, |
| 86 | + GeometryTypes.MULTI_POLYGON.value])) |
87 | 87 | nil_values: list = Field(None, serialization_alias='nilValues') |
88 | 88 | srs: str = Field(...) |
89 | 89 | value: Geometry = Field(None) |
|
0 commit comments