diff --git a/opengeodeweb_back_schemas.json b/opengeodeweb_back_schemas.json index 0937f3fa..e3a1dc63 100644 --- a/opengeodeweb_back_schemas.json +++ b/opengeodeweb_back_schemas.json @@ -10,6 +10,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -23,7 +24,10 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId", + "type": "string", + "minLength": 32, + "maxLength": 32 } }, "required": [ @@ -78,7 +82,7 @@ "additionalProperties": false }, "crs": { - "title": "CRSParams", + "title": "CRS", "type": "object", "properties": { "authority": { @@ -129,6 +133,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -137,13 +142,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -155,21 +194,26 @@ "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -278,7 +322,7 @@ "points": { "type": "array", "items": { - "title": "PolygonalSurfacePoint", + "title": "Point3D", "type": "object", "properties": { "x": { @@ -325,6 +369,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -333,13 +378,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -353,12 +432,15 @@ "mesh_components": { "type": "array", "items": { + "title": "MeshComponent", "type": "object", "properties": { "viewer_id": { + "title": "ViewerId", "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -372,6 +454,7 @@ "boundaries": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -380,6 +463,7 @@ "internals": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -404,9 +488,11 @@ "collection_components": { "type": "array", "items": { + "title": "CollectionComponent", "type": "object", "properties": { "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -420,6 +506,7 @@ "items": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -440,21 +527,26 @@ } }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -492,6 +584,7 @@ "points": { "type": "array", "items": { + "title": "Point3D", "type": "object", "properties": { "x": { @@ -526,6 +619,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -534,13 +628,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -554,12 +682,15 @@ "mesh_components": { "type": "array", "items": { + "title": "MeshComponent", "type": "object", "properties": { "viewer_id": { + "title": "ViewerId", "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -573,6 +704,7 @@ "boundaries": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -581,6 +713,7 @@ "internals": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -605,9 +738,11 @@ "collection_components": { "type": "array", "items": { + "title": "CollectionComponent", "type": "object", "properties": { "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -621,6 +756,7 @@ "items": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -641,21 +777,26 @@ } }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -719,6 +860,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -727,13 +869,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -747,12 +923,15 @@ "mesh_components": { "type": "array", "items": { + "title": "MeshComponent", "type": "object", "properties": { "viewer_id": { + "title": "ViewerId", "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -766,6 +945,7 @@ "boundaries": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -774,6 +954,7 @@ "internals": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -798,9 +979,11 @@ "collection_components": { "type": "array", "items": { + "title": "CollectionComponent", "type": "object", "properties": { "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -814,6 +997,7 @@ "items": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -834,21 +1018,26 @@ } }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -886,7 +1075,7 @@ "points": { "type": "array", "items": { - "title": "EdgedCurvePoint", + "title": "Point3D", "type": "object", "properties": { "x": { @@ -934,6 +1123,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -942,13 +1132,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -962,12 +1186,15 @@ "mesh_components": { "type": "array", "items": { + "title": "MeshComponent", "type": "object", "properties": { "viewer_id": { + "title": "ViewerId", "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -981,6 +1208,7 @@ "boundaries": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -989,6 +1217,7 @@ "internals": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1013,9 +1242,11 @@ "collection_components": { "type": "array", "items": { + "title": "CollectionComponent", "type": "object", "properties": { "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1029,6 +1260,7 @@ "items": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1049,21 +1281,26 @@ } }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1097,8 +1334,36 @@ "type": "object", "properties": { "geode_object_type": { + "title": "GeodeObjectType", "type": "string", - "minLength": 1 + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] } }, "required": [ @@ -1111,22 +1376,26 @@ "crs_list": { "type": "array", "items": { + "title": "CRS", "type": "object", "properties": { - "name": { - "type": "string" + "authority": { + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, - "authority": { - "type": "string" + "name": { + "type": "string", + "minLength": 1 } }, "required": [ - "name", + "authority", "code", - "authority" + "name" ], "additionalProperties": false } @@ -1147,6 +1416,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1154,6 +1424,7 @@ "linked_ids": { "type": "array", "items": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1187,16 +1458,20 @@ "type": "string" }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1212,19 +1487,26 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId", + "type": "string", + "minLength": 32, + "maxLength": 32 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1258,6 +1540,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1265,6 +1548,7 @@ "linked_ids": { "type": "array", "items": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1298,16 +1582,20 @@ "type": "object", "properties": { "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1326,19 +1614,26 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId", + "type": "string", + "minLength": 32, + "maxLength": 32 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1372,6 +1667,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1379,6 +1675,7 @@ "linked_ids": { "type": "array", "items": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1460,16 +1757,20 @@ "type": "string" }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1485,22 +1786,29 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId", + "type": "string", + "minLength": 32, + "maxLength": 32 }, "binary_light_viewable": { "type": "string" }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1531,6 +1839,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1547,16 +1856,20 @@ "type": "string" }, "crs_info": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -1583,11 +1896,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -1633,6 +1948,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1648,10 +1964,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -1691,6 +2010,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1734,6 +2054,7 @@ "type": "object", "properties": { "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -1761,6 +2082,7 @@ "type": "object", "properties": { "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -1805,6 +2127,7 @@ "type": "object", "properties": { "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -1838,6 +2161,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1872,10 +2196,39 @@ "type": "object", "properties": { "geode_object_type": { + "title": "GeodeObjectType", "type": "string", - "minLength": 1 + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -1898,6 +2251,7 @@ "type": "string" }, "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -1906,13 +2260,47 @@ "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType", + "type": "string", + "enum": [ + "mesh", + "model" + ] }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "viewable_file": { "type": "string" @@ -1926,12 +2314,15 @@ "mesh_components": { "type": "array", "items": { + "title": "MeshComponent", "type": "object", "properties": { "viewer_id": { + "title": "ViewerId", "type": "integer" }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1945,6 +2336,7 @@ "boundaries": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1953,6 +2345,7 @@ "internals": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1977,9 +2370,11 @@ "collection_components": { "type": "array", "items": { + "title": "CollectionComponent", "type": "object", "properties": { "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -1993,6 +2388,7 @@ "items": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2013,21 +2409,26 @@ } }, "geode_id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 }, "crs": { + "title": "CRS", "type": "object", "properties": { "authority": { - "type": "string" + "type": "string", + "minLength": 1 }, "code": { - "type": "string" + "type": "string", + "minLength": 1 }, "name": { - "type": "string" + "type": "string", + "minLength": 1 } }, "required": [ @@ -2066,11 +2467,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2116,6 +2519,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2131,10 +2535,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2174,11 +2581,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2224,6 +2633,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2239,10 +2649,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2305,6 +2718,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2312,6 +2726,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2319,6 +2734,7 @@ "minItems": 1 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2365,6 +2781,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2372,6 +2789,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2390,10 +2808,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2433,6 +2854,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2440,6 +2862,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2447,6 +2870,7 @@ "minItems": 1 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2493,6 +2917,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2500,6 +2925,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2518,10 +2944,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2561,6 +2990,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2568,6 +2998,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2575,6 +3006,7 @@ "minItems": 1 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2621,6 +3053,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2628,6 +3061,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2646,10 +3080,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2689,6 +3126,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2696,6 +3134,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2703,6 +3142,7 @@ "minItems": 1 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -2749,6 +3189,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2756,6 +3197,7 @@ "component_ids": { "type": "array", "items": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2774,10 +3216,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -2863,6 +3308,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -2881,6 +3327,7 @@ "type": "object", "properties": { "id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2902,6 +3349,7 @@ "type": "object", "properties": { "id": { + "title": "GeodeId", "type": "string", "minLength": 36, "maxLength": 36 @@ -2934,10 +3382,39 @@ "type": "object", "properties": { "geode_object_type": { + "title": "GeodeObjectType", "type": "string", - "minLength": 1 + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -2975,8 +3452,36 @@ "type": "object", "properties": { "geode_object_type": { + "title": "GeodeObjectType", "type": "string", - "minLength": 1 + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] } }, "required": [ @@ -2989,13 +3494,71 @@ "parents": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] } }, "children": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] } } }, @@ -3018,6 +3581,7 @@ "type": "object" }, "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -3040,11 +3604,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -3090,6 +3656,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -3105,10 +3672,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -3148,10 +3718,39 @@ "type": "object", "properties": { "geode_object_type": { + "title": "GeodeObjectType", "type": "string", - "minLength": 1 + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] }, "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -3197,11 +3796,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "attribute_name": { + "title": "AttributeName", "type": "string", "minLength": 1 } @@ -3247,6 +3848,7 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 @@ -3262,10 +3864,13 @@ "attributes": { "type": "array", "items": { + "title": "AttributeInfo", "type": "object", "properties": { "attribute_name": { - "type": "string" + "title": "AttributeName", + "type": "string", + "minLength": 1 }, "attribute_id": { "type": "string" @@ -3305,11 +3910,13 @@ "type": "object", "properties": { "id": { + "title": "DataId", "type": "string", "minLength": 32, "maxLength": 32 }, "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -3335,6 +3942,7 @@ "type": "object", "properties": { "filename": { + "title": "Filename", "type": "string", "minLength": 1 } @@ -3372,7 +3980,36 @@ "objects_to_load": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType", + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] } } }, diff --git a/opengeodeweb_back_typed_schemas.d.ts b/opengeodeweb_back_typed_schemas.d.ts index 74c01a25..a3d1d297 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -1,17 +1,21 @@ // Generated by opengeodeweb-microservice-generate, do not edit. import type json from "./opengeodeweb_back_schemas.json"; +import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types"; +import type { AttributeInfo, AttributeName, CRS, CollectionComponent, Filename, MeshComponent, Point3D, ViewerId } from "@geode/opengeodeweb-back/schema_types"; +import type { GeodeObjectType, ViewerObjectType } from "@geode/opengeodeweb-microservice/data_types"; + export interface BasemapDeleteParams { - id: string; + id: DataId; } export interface BasemapDeleteResponse { - id: string; + id: DataId; } export interface BasemapBuildParams { bounds: Bounds; - crs: CRSParams; + crs: CRS; maps: Map[]; margin?: boolean; max_pixels?: number; @@ -25,12 +29,6 @@ export interface Bounds { y_min: number; } -export interface CRSParams { - authority: string; - code: string; - name: string; -} - export type Map = "satellite" | "plan" | "routes"; export interface BasemapBuildResponse { @@ -38,10 +36,10 @@ export interface BasemapBuildResponse { binary_light_viewable?: string; bounds: MeshBounds; columns: number; - crs?: BasemapBuildResponseCRS; - geode_id: string; - geode_object_type: string; - id: string; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; maps: MapElement[]; name: string; @@ -49,7 +47,7 @@ export interface BasemapBuildResponse { nb_vertices?: number; rows: number; viewable_file?: string; - viewer_object_type: string; + viewer_object_type: ViewerObjectType; zoom: number; } @@ -60,12 +58,6 @@ export interface MeshBounds { y_min: number; } -export interface BasemapBuildResponseCRS { - authority: string; - code: string; - name: string; -} - export interface MapElement { map: string; sources: string[]; @@ -73,105 +65,45 @@ export interface MapElement { export interface CreatePolygonalSurfaceParams { name: string; - points: PolygonalSurfacePoint[]; + points: Point3D[]; polygons: Array; } -export interface PolygonalSurfacePoint { - x: number; - y: number; - z: number; -} - export interface CreatePolygonalSurfaceResponse { binary_light_viewable?: string; - collection_components?: CreatePolygonalSurfaceResponseCollectionComponent[]; - crs?: CreatePolygonalSurfaceResponseCRS; - geode_id: string; - geode_object_type: string; - id: string; + collection_components?: CollectionComponent[]; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; - mesh_components?: CreatePolygonalSurfaceResponseMeshComponent[]; + mesh_components?: MeshComponent[]; name: string; native_file: string; nb_vertices?: number; viewable_file?: string; - viewer_object_type: string; -} - -export interface CreatePolygonalSurfaceResponseCollectionComponent { - geode_id: string; - is_active: boolean; - items: string[]; - name: string; - type: string; -} - -export interface CreatePolygonalSurfaceResponseCRS { - authority: string; - code: string; - name: string; -} - -export interface CreatePolygonalSurfaceResponseMeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; - is_active: boolean; - name: string; - type: string; - viewer_id: number; + viewer_object_type: ViewerObjectType; } export interface CreatePointSetParams { name: string; - points: Point[]; -} - -export interface Point { - x: number; - y: number; - z: number; + points: Point3D[]; } export interface CreatePointSetResponse { binary_light_viewable?: string; - collection_components?: CreatePointSetResponseCollectionComponent[]; - crs?: CreatePointSetResponseCRS; - geode_id: string; - geode_object_type: string; - id: string; + collection_components?: CollectionComponent[]; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; - mesh_components?: CreatePointSetResponseMeshComponent[]; + mesh_components?: MeshComponent[]; name: string; native_file: string; nb_vertices?: number; viewable_file?: string; - viewer_object_type: string; -} - -export interface CreatePointSetResponseCollectionComponent { - geode_id: string; - is_active: boolean; - items: string[]; - name: string; - type: string; -} - -export interface CreatePointSetResponseCRS { - authority: string; - code: string; - name: string; -} - -export interface CreatePointSetResponseMeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; - is_active: boolean; - name: string; - type: string; - viewer_id: number; + viewer_object_type: ViewerObjectType; } export interface CreateHorizonStackParams { @@ -182,180 +114,96 @@ export interface CreateHorizonStackParams { export interface CreateHorizonStackResponse { binary_light_viewable?: string; - collection_components?: CreateHorizonStackResponseCollectionComponent[]; - crs?: CreateHorizonStackResponseCRS; - geode_id: string; - geode_object_type: string; - id: string; + collection_components?: CollectionComponent[]; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; - mesh_components?: CreateHorizonStackResponseMeshComponent[]; + mesh_components?: MeshComponent[]; name: string; native_file: string; nb_vertices?: number; viewable_file?: string; - viewer_object_type: string; -} - -export interface CreateHorizonStackResponseCollectionComponent { - geode_id: string; - is_active: boolean; - items: string[]; - name: string; - type: string; -} - -export interface CreateHorizonStackResponseCRS { - authority: string; - code: string; - name: string; -} - -export interface CreateHorizonStackResponseMeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; - is_active: boolean; - name: string; - type: string; - viewer_id: number; + viewer_object_type: ViewerObjectType; } export interface CreateEdgedCurveParams { edges: Array; name: string; - points: EdgedCurvePoint[]; -} - -export interface EdgedCurvePoint { - x: number; - y: number; - z: number; + points: Point3D[]; } export interface CreateEdgedCurveResponse { binary_light_viewable?: string; - collection_components?: CreateEdgedCurveResponseCollectionComponent[]; - crs?: CreateEdgedCurveResponseCRS; - geode_id: string; - geode_object_type: string; - id: string; + collection_components?: CollectionComponent[]; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; - mesh_components?: CreateEdgedCurveResponseMeshComponent[]; + mesh_components?: MeshComponent[]; name: string; native_file: string; nb_vertices?: number; viewable_file?: string; - viewer_object_type: string; -} - -export interface CreateEdgedCurveResponseCollectionComponent { - geode_id: string; - is_active: boolean; - items: string[]; - name: string; - type: string; -} - -export interface CreateEdgedCurveResponseCRS { - authority: string; - code: string; - name: string; -} - -export interface CreateEdgedCurveResponseMeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; - is_active: boolean; - name: string; - type: string; - viewer_id: number; + viewer_object_type: ViewerObjectType; } export interface CRSGeographicListParams { - geode_object_type: string; + geode_object_type: GeodeObjectType; } export interface CRSGeographicListResponse { - crs_list: CRSList[]; -} - -export interface CRSList { - authority: string; - code: string; - name: string; + crs_list: CRS[]; } export interface CRSConvertGeographicParams { authority: string; code: string; - id: string; - linked_ids?: string[]; + id: DataId; + linked_ids?: DataId[]; name: string; } export interface CRSConvertGeographicResponse { binary_light_viewable?: string; - crs?: CRSConvertGeographicResponseCRS; + crs?: CRS; linked?: CRSConvertGeographicResponseLinked[]; } -export interface CRSConvertGeographicResponseCRS { - authority: string; - code: string; - name: string; -} - export interface CRSConvertGeographicResponseLinked { binary_light_viewable?: string; - crs?: PurpleCRS; - id: string; -} - -export interface PurpleCRS { - authority: string; - code: string; - name: string; + crs?: CRS; + id: DataId; } export interface CRSAssignGeographicParams { authority: string; code: string; - id: string; - linked_ids?: string[]; + id: DataId; + linked_ids?: DataId[]; name: string; only_plausible?: boolean; } export interface CRSAssignGeographicResponse { - crs?: CRSAssignGeographicResponseCRS; + crs?: CRS; implausible?: boolean; linked?: CRSAssignGeographicResponseLinked[]; } -export interface CRSAssignGeographicResponseCRS { - authority: string; - code: string; - name: string; -} - export interface CRSAssignGeographicResponseLinked { - crs?: FluffyCRS; - id: string; + crs?: CRS; + id: DataId; implausible?: boolean; } -export interface FluffyCRS { - authority: string; - code: string; - name: string; -} - export interface CRSAlignParams { authority: string; code: string; - id: string; - linked_ids?: string[]; + id: DataId; + linked_ids?: DataId[]; name: string; source_points: SourcePoint[]; target_points: TargetPoint[]; @@ -374,46 +222,28 @@ export interface TargetPoint { export interface CRSAlignResponse { binary_light_viewable?: string; - crs?: CRSAlignResponseCRS; + crs?: CRS; linked?: CRSAlignResponseLinked[]; } -export interface CRSAlignResponseCRS { - authority: string; - code: string; - name: string; -} - export interface CRSAlignResponseLinked { binary_light_viewable?: string; - crs?: TentacledCRS; - id: string; -} - -export interface TentacledCRS { - authority: string; - code: string; - name: string; + crs?: CRS; + id: DataId; } export interface CRSActiveParams { - id: string; + id: DataId; } export interface CRSActiveResponse { - crs_info?: CRSInfo; + crs_info?: CRS; crs_name: string; } -export interface CRSInfo { - authority: string; - code: string; - name: string; -} - export interface VertexAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface VertexAttributeRangeResponse { @@ -423,22 +253,15 @@ export interface VertexAttributeRangeResponse { } export interface VertexAttributeNamesParams { - id: string; + id: DataId; } export interface VertexAttributeNamesResponse { - attributes: VertexAttributeNamesResponseAttribute[]; -} - -export interface VertexAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface ValidateParams { - id: string; + id: DataId; } export interface ValidateResponse { @@ -448,7 +271,7 @@ export interface ValidateResponse { } export interface UploadFileParams { - filename?: string; + filename?: Filename; } export interface UploadFileResponse { @@ -456,7 +279,7 @@ export interface UploadFileResponse { } export interface TimeSeriesMissingFilesParams { - filename: string; + filename: Filename; } export interface TimeSeriesMissingFilesResponse { @@ -466,7 +289,7 @@ export interface TimeSeriesMissingFilesResponse { } export interface TimeSeriesAllowedObjectsParams { - filename: string; + filename: Filename; } export interface TimeSeriesAllowedObjectsResponse { @@ -474,7 +297,7 @@ export interface TimeSeriesAllowedObjectsResponse { } export interface TextureCoordinatesParams { - id: string; + id: DataId; } export interface TextureCoordinatesResponse { @@ -482,8 +305,8 @@ export interface TextureCoordinatesResponse { } export interface SaveViewableFileParams { - filename: string; - geode_object_type: string; + filename: Filename; + geode_object_type: GeodeObjectType; } export interface SaveViewableFileResponse { @@ -492,47 +315,23 @@ export interface SaveViewableFileResponse { export interface SaveViewableFileItem { binary_light_viewable?: string; - collection_components?: DatumCollectionComponent[]; - crs?: DatumCRS; - geode_id: string; - geode_object_type: string; - id: string; + collection_components?: CollectionComponent[]; + crs?: CRS; + geode_id: GeodeId; + geode_object_type: GeodeObjectType; + id: DataId; is_viewable: boolean; - mesh_components?: DatumMeshComponent[]; + mesh_components?: MeshComponent[]; name: string; native_file: string; nb_vertices?: number; viewable_file?: string; - viewer_object_type: string; -} - -export interface DatumCollectionComponent { - geode_id: string; - is_active: boolean; - items: string[]; - name: string; - type: string; -} - -export interface DatumCRS { - authority: string; - code: string; - name: string; -} - -export interface DatumMeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; - is_active: boolean; - name: string; - type: string; - viewer_id: number; + viewer_object_type: ViewerObjectType; } export interface PolyhedronAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface PolyhedronAttributeRangeResponse { @@ -542,23 +341,16 @@ export interface PolyhedronAttributeRangeResponse { } export interface PolyhedronAttributeNamesParams { - id: string; + id: DataId; } export interface PolyhedronAttributeNamesResponse { - attributes: PolyhedronAttributeNamesResponseAttribute[]; -} - -export interface PolyhedronAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface PolygonAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface PolygonAttributeRangeResponse { @@ -568,18 +360,11 @@ export interface PolygonAttributeRangeResponse { } export interface PolygonAttributeNamesParams { - id: string; + id: DataId; } export interface PolygonAttributeNamesResponse { - attributes: PolygonAttributeNamesResponseAttribute[]; -} - -export interface PolygonAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface PingParams { @@ -590,9 +375,9 @@ export interface PingResponse { } export interface ModelComponentVertexAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentVertexAttributeRangeResponse { @@ -602,25 +387,18 @@ export interface ModelComponentVertexAttributeRangeResponse { } export interface ModelComponentVertexAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentVertexAttributeNamesResponse { - attributes: ModelComponentVertexAttributeNamesResponseAttribute[]; -} - -export interface ModelComponentVertexAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface ModelComponentPolyhedronAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolyhedronAttributeRangeResponse { @@ -630,25 +408,18 @@ export interface ModelComponentPolyhedronAttributeRangeResponse { } export interface ModelComponentPolyhedronAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolyhedronAttributeNamesResponse { - attributes: ModelComponentPolyhedronAttributeNamesResponseAttribute[]; -} - -export interface ModelComponentPolyhedronAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface ModelComponentPolygonAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolygonAttributeRangeResponse { @@ -658,25 +429,18 @@ export interface ModelComponentPolygonAttributeRangeResponse { } export interface ModelComponentPolygonAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolygonAttributeNamesResponse { - attributes: ModelComponentPolygonAttributeNamesResponseAttribute[]; -} - -export interface ModelComponentPolygonAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface ModelComponentEdgeAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentEdgeAttributeRangeResponse { @@ -686,19 +450,12 @@ export interface ModelComponentEdgeAttributeRangeResponse { } export interface ModelComponentEdgeAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentEdgeAttributeNamesResponse { - attributes: ModelComponentEdgeAttributeNamesResponseAttribute[]; -} - -export interface ModelComponentEdgeAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface KillParams { @@ -716,7 +473,7 @@ export interface ImportProjectResponse { } export interface HorizonStackInfoParams { - id: string; + id: DataId; } export interface HorizonStackInfoResponse { @@ -725,18 +482,18 @@ export interface HorizonStackInfoResponse { } export interface Horizon { - id: string; + id: GeodeId; name: string; } export interface Unit { - id: string; + id: GeodeId; name: string; } export interface GeodeObjectsAndOutputExtensionsParams { - filename: string; - geode_object_type: string; + filename: Filename; + geode_object_type: GeodeObjectType; } export interface GeodeObjectsAndOutputExtensionsResponse { @@ -744,22 +501,22 @@ export interface GeodeObjectsAndOutputExtensionsResponse { } export interface GeodeObjectInheritanceParams { - geode_object_type: string; + geode_object_type: GeodeObjectType; } export interface GeodeObjectInheritanceResponse { - children: string[]; - parents: string[]; + children: GeodeObjectType[]; + parents: GeodeObjectType[]; } export interface ExportProjectParams { - filename: string; + filename: Filename; snapshot: { [key: string]: any }; } export interface EdgeAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface EdgeAttributeRangeResponse { @@ -769,23 +526,16 @@ export interface EdgeAttributeRangeResponse { } export interface EdgeAttributeNamesParams { - id: string; + id: DataId; } export interface EdgeAttributeNamesResponse { - attributes: EdgeAttributeNamesResponseAttribute[]; -} - -export interface EdgeAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface DataMissingFilesParams { - filename: string; - geode_object_type: string; + filename: Filename; + geode_object_type: GeodeObjectType; } export interface DataMissingFilesResponse { @@ -795,8 +545,8 @@ export interface DataMissingFilesResponse { } export interface CellAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface CellAttributeRangeResponse { @@ -806,35 +556,28 @@ export interface CellAttributeRangeResponse { } export interface CellAttributeNamesParams { - id: string; + id: DataId; } export interface CellAttributeNamesResponse { - attributes: CellAttributeNamesResponseAttribute[]; -} - -export interface CellAttributeNamesResponseAttribute { - attribute_id: string; - attribute_name: string; - nb_items: number; - time_steps: number[]; + attributes: AttributeInfo[]; } export interface ApplyTimeSeriesParams { - filename: string; - id: string; + filename: Filename; + id: DataId; } export interface ApplyTimeSeriesResponse { } export interface AllowedObjectsParams { - filename: string; + filename: Filename; } export interface AllowedObjectsResponse { allowed_objects: { [key: string]: AllowedObject }; - objects_to_load: string[]; + objects_to_load: GeodeObjectType[]; } export interface AllowedObject { diff --git a/package.json b/package.json index 2d19dad0..773d38ee 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,10 @@ "files": [ "opengeodeweb_back_schemas.json", "opengeodeweb_back_typed_schemas.js", - "opengeodeweb_back_typed_schemas.d.ts" + "opengeodeweb_back_typed_schemas.d.ts", + "src/opengeodeweb_back/schema_types.json", + "src/opengeodeweb_back/schema_types.d.ts", + "src/opengeodeweb_back/schema_types.py" ], "exports": { "./opengeodeweb_back_schemas.json": { @@ -29,6 +32,9 @@ "./opengeodeweb_back_typed_schemas.js": { "types": "./opengeodeweb_back_typed_schemas.d.ts", "default": "./opengeodeweb_back_typed_schemas.js" + }, + "./schema_types": { + "types": "./src/opengeodeweb_back/schema_types.d.ts" } }, "publishConfig": { diff --git a/pyproject.toml b/pyproject.toml index fc1777c0..8127282a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,4 +35,4 @@ where = ["src"] "opengeodeweb_back.routes.create.schemas" = ["*.json"] "opengeodeweb_back.routes.crs.schemas" = ["*.json"] "opengeodeweb_back.routes.basemap.schemas" = ["*.json"] -"opengeodeweb_back" = ["py.typed"] +"opengeodeweb_back" = ["py.typed", "schema_definitions.json"] diff --git a/requirements.txt b/requirements.txt index 38266610..597e5178 100644 --- a/requirements.txt +++ b/requirements.txt @@ -84,4 +84,3 @@ werkzeug==3.1.8 # flask # flask-cors -opengeodeweb-microservice==1.*,>=1.3.3 diff --git a/src/opengeodeweb_back/geode_functions.py b/src/opengeodeweb_back/geode_functions.py index d7b4d755..d92144e6 100644 --- a/src/opengeodeweb_back/geode_functions.py +++ b/src/opengeodeweb_back/geode_functions.py @@ -88,7 +88,7 @@ def geode_object_output_extensions( return results -def objects_to_load(allowed: dict[str, AllowedObject]) -> list[str]: +def objects_to_load(allowed: dict[str, AllowedObject]) -> list[GeodeObjectType]: """Pick the one type to load per content family so the whole file is loaded. Per family: keep loadable candidates, then highest is_loadable, then highest @@ -100,7 +100,7 @@ def objects_to_load(allowed: dict[str, AllowedObject]) -> list[str]: families.setdefault(allowed_object.loadable_family, []).append( (object_type, allowed_object) ) - winners: list[str] = [] + winners: list[GeodeObjectType] = [] for candidates in families.values(): best_loadable = max(candidate.is_loadable for _, candidate in candidates) best = [c for c in candidates if c[1].is_loadable == best_loadable] @@ -108,5 +108,5 @@ def objects_to_load(allowed: dict[str, AllowedObject]) -> list[str]: best = [c for c in best if c[1].object_priority == best_priority] if len(best) != 1: return [] - winners.append(best[0][0]) + winners.append(geode_object_type(best[0][0])) return winners diff --git a/src/opengeodeweb_back/routes/basemap/blueprint_basemap.py b/src/opengeodeweb_back/routes/basemap/blueprint_basemap.py index 3e3610f2..064904ea 100644 --- a/src/opengeodeweb_back/routes/basemap/blueprint_basemap.py +++ b/src/opengeodeweb_back/routes/basemap/blueprint_basemap.py @@ -23,6 +23,7 @@ from opengeodeweb_back.geode_objects.geode_triangulated_surface3d import ( GeodeTriangulatedSurface3D, ) + from opengeodeweb_back.schema_types import CRS routes = flask.Blueprint("basemap", __name__, url_prefix="/basemap") logger = logging.getLogger(__name__) @@ -48,7 +49,7 @@ def padded(bounds: tuple[float, float, float, float]) -> tuple[float, float, flo ) -def _crs(params: schemas.CRSParams) -> og_geosciences.GeographicCoordinateSystemInfo: +def _crs(params: CRS) -> og_geosciences.GeographicCoordinateSystemInfo: key = f"{params.authority}:{params.code}" # The basemap is a 3D mesh: only list the CRS a 3D object accepts crs = geographic_coordinate_systems(True).get(key) # noqa: FBT003 diff --git a/src/opengeodeweb_back/routes/basemap/schemas/build.json b/src/opengeodeweb_back/routes/basemap/schemas/build.json index 48ab35c1..e1f4c6e1 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/build.json +++ b/src/opengeodeweb_back/routes/basemap/schemas/build.json @@ -43,34 +43,21 @@ "additionalProperties": false }, "crs": { - "title": "CRSParams", - "type": "object", - "properties": { - "authority": { - "type": "string", - "minLength": 1 - }, - "code": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "z": { "type": "number" }, - "margin": { "type": "boolean", "default": true }, - "max_pixels": { "type": "integer", "minimum": 256, "maximum": 4096, "default": 2048 } + "margin": { + "type": "boolean", + "default": true + }, + "max_pixels": { + "type": "integer", + "minimum": 256, + "maximum": 4096, + "default": 2048 + } }, "required": [ "maps", @@ -86,21 +73,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -112,29 +97,10 @@ "type": "integer" }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "columns": { "type": "integer", @@ -147,17 +113,33 @@ "attribution": { "type": "string" }, - "zoom": { "type": "integer", "minimum": 0 }, + "zoom": { + "type": "integer", + "minimum": 0 + }, "bounds": { "title": "MeshBounds", "type": "object", "properties": { - "x_min": { "type": "number" }, - "y_min": { "type": "number" }, - "x_max": { "type": "number" }, - "y_max": { "type": "number" } + "x_min": { + "type": "number" + }, + "y_min": { + "type": "number" + }, + "x_max": { + "type": "number" + }, + "y_max": { + "type": "number" + } }, - "required": ["x_min", "y_min", "x_max", "y_max"], + "required": [ + "x_min", + "y_min", + "x_max", + "y_max" + ], "additionalProperties": false }, "maps": { diff --git a/src/opengeodeweb_back/routes/basemap/schemas/build.py b/src/opengeodeweb_back/routes/basemap/schemas/build.py index f737f9fd..b798c0cd 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/build.py +++ b/src/opengeodeweb_back/routes/basemap/schemas/build.py @@ -1,3 +1,6 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_back.schema_types import CRS from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -18,16 +21,6 @@ def __post_init__(self) -> None: y_min: float -@dataclass -class CRSParams(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - class Map(Enum): PLAN = "plan" ROUTES = "routes" @@ -40,7 +33,7 @@ def __post_init__(self) -> None: print_dataclass(self) bounds: Bounds - crs: CRSParams + crs: CRS maps: List[Map] z: float margin: Optional[bool] = None @@ -58,16 +51,6 @@ def __post_init__(self) -> None: y_min: float -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - @dataclass class MapElement(DataClassJsonMixin): def __post_init__(self) -> None: @@ -85,15 +68,15 @@ def __post_init__(self) -> None: attribution: str bounds: MeshBounds columns: int - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool maps: List[MapElement] name: str native_file: str rows: int - viewer_object_type: str + viewer_object_type: ViewerObjectType zoom: int binary_light_viewable: Optional[str] = None crs: Optional[CRS] = None @@ -107,4 +90,4 @@ def __post_init__(self) -> None: response=BuildResponse, ) -__all__ = ["Bounds", "CRSParams", "Build", "BuildResponse", "build_route"] +__all__ = ["Bounds", "CRS", "Build", "BuildResponse", "build_route"] diff --git a/src/opengeodeweb_back/routes/basemap/schemas/delete.json b/src/opengeodeweb_back/routes/basemap/schemas/delete.json index b8b64512..c8fb3b94 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/delete.json +++ b/src/opengeodeweb_back/routes/basemap/schemas/delete.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -19,7 +17,7 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/basemap/schemas/delete.py b/src/opengeodeweb_back/routes/basemap/schemas/delete.py index ceb9d444..4b3d7e7e 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/delete.py +++ b/src/opengeodeweb_back/routes/basemap/schemas/delete.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -10,7 +11,7 @@ class Delete(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass @@ -18,7 +19,7 @@ class DeleteResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId delete_route = Route( diff --git a/src/opengeodeweb_back/routes/blueprint_routes.py b/src/opengeodeweb_back/routes/blueprint_routes.py index 03dc326f..0c23976a 100644 --- a/src/opengeodeweb_back/routes/blueprint_routes.py +++ b/src/opengeodeweb_back/routes/blueprint_routes.py @@ -45,6 +45,7 @@ from opengeodeweb_back.typed_route import parse_params, raw_route, typed_route if TYPE_CHECKING: + from opengeodeweb_microservice.database.data_types import GeodeObjectType from werkzeug.datastructures import FileStorage @@ -1001,8 +1002,8 @@ def get_all_subclasses(geode_class: type) -> set[type]: subclass_classes = get_all_subclasses(target_class) # Filter GeodeObjectType to only include registered related objects, excluding target - parents: list[str] = [] - children: list[str] = [] + parents: list[GeodeObjectType] = [] + children: list[GeodeObjectType] = [] for geode_object_type_str, geode_class in geode_objects.items(): if geode_class == target_class: continue diff --git a/src/opengeodeweb_back/routes/create/schemas/edged_curve.json b/src/opengeodeweb_back/routes/create/schemas/edged_curve.json index c68690a5..5a4e7632 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.json +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.json @@ -12,25 +12,7 @@ "points": { "type": "array", "items": { - "title": "EdgedCurvePoint", - "type": "object", - "properties": { - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "z": { - "type": "number" - } - }, - "required": [ - "x", - "y", - "z" - ], - "additionalProperties": false + "title": "Point3D" }, "minItems": 2 }, @@ -60,21 +42,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -88,116 +68,20 @@ "mesh_components": { "type": "array", "items": { - "type": "object", - "properties": { - "viewer_id": { - "type": "integer" - }, - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "boundaries": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "internals": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "viewer_id", - "geode_id", - "name", - "type", - "boundaries", - "internals", - "is_active" - ], - "additionalProperties": false + "title": "MeshComponent" } }, "collection_components": { "type": "array", "items": { - "type": "object", - "properties": { - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "geode_id", - "name", - "type", - "items", - "is_active" - ], - "additionalProperties": false + "title": "CollectionComponent" } }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py index 972baa90..fb16e388 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py @@ -1,3 +1,6 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -7,16 +10,6 @@ from typing import List -@dataclass -class EdgedCurvePoint(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - x: float - y: float - z: float - - @dataclass class EdgedCurve(DataClassJsonMixin): def __post_init__(self) -> None: @@ -24,43 +17,7 @@ def __post_init__(self) -> None: edges: List[List[int]] name: str - points: List[EdgedCurvePoint] - - -@dataclass -class CollectionComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - geode_id: str - is_active: bool - items: List[str] - name: str - type: str - - -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - -@dataclass -class MeshComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - boundaries: List[str] - geode_id: str - internals: List[str] - is_active: bool - name: str - type: str - viewer_id: int + points: List[Point3D] @dataclass @@ -68,13 +25,13 @@ class EdgedCurveResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool name: str native_file: str - viewer_object_type: str + viewer_object_type: ViewerObjectType binary_light_viewable: Optional[str] = None collection_components: Optional[List[CollectionComponent]] = None crs: Optional[CRS] = None @@ -89,4 +46,4 @@ def __post_init__(self) -> None: response=EdgedCurveResponse, ) -__all__ = ["EdgedCurvePoint", "EdgedCurve", "EdgedCurveResponse", "edged_curve_route"] +__all__ = ["Point3D", "EdgedCurve", "EdgedCurveResponse", "edged_curve_route"] diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.json b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.json index 5a7e6f2d..d8ef531a 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.json +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.json @@ -38,21 +38,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -66,116 +64,20 @@ "mesh_components": { "type": "array", "items": { - "type": "object", - "properties": { - "viewer_id": { - "type": "integer" - }, - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "boundaries": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "internals": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "viewer_id", - "geode_id", - "name", - "type", - "boundaries", - "internals", - "is_active" - ], - "additionalProperties": false + "title": "MeshComponent" } }, "collection_components": { "type": "array", "items": { - "type": "object", - "properties": { - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "geode_id", - "name", - "type", - "items", - "is_active" - ], - "additionalProperties": false + "title": "CollectionComponent" } }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py index f2c22417..d446c63c 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,3 +1,6 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, ViewerId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -17,54 +20,18 @@ def __post_init__(self) -> None: unit_names: List[str] -@dataclass -class CollectionComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - geode_id: str - is_active: bool - items: List[str] - name: str - type: str - - -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - -@dataclass -class MeshComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - boundaries: List[str] - geode_id: str - internals: List[str] - is_active: bool - name: str - type: str - viewer_id: int - - @dataclass class HorizonStackResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool name: str native_file: str - viewer_object_type: str + viewer_object_type: ViewerObjectType binary_light_viewable: Optional[str] = None collection_components: Optional[List[CollectionComponent]] = None crs: Optional[CRS] = None diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.json b/src/opengeodeweb_back/routes/create/schemas/point_set.json index 0618bb78..869d6356 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.json +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.json @@ -12,24 +12,7 @@ "points": { "type": "array", "items": { - "type": "object", - "properties": { - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "z": { - "type": "number" - } - }, - "required": [ - "x", - "y", - "z" - ], - "additionalProperties": false + "title": "Point3D" }, "minItems": 1 } @@ -46,21 +29,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -74,116 +55,20 @@ "mesh_components": { "type": "array", "items": { - "type": "object", - "properties": { - "viewer_id": { - "type": "integer" - }, - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "boundaries": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "internals": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "viewer_id", - "geode_id", - "name", - "type", - "boundaries", - "internals", - "is_active" - ], - "additionalProperties": false + "title": "MeshComponent" } }, "collection_components": { "type": "array", "items": { - "type": "object", - "properties": { - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "geode_id", - "name", - "type", - "items", - "is_active" - ], - "additionalProperties": false + "title": "CollectionComponent" } }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.py b/src/opengeodeweb_back/routes/create/schemas/point_set.py index 00153372..e0af2779 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.py +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.py @@ -1,3 +1,6 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -7,59 +10,13 @@ from typing import List -@dataclass -class Point(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - x: float - y: float - z: float - - @dataclass class PointSet(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) name: str - points: List[Point] - - -@dataclass -class CollectionComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - geode_id: str - is_active: bool - items: List[str] - name: str - type: str - - -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - -@dataclass -class MeshComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - boundaries: List[str] - geode_id: str - internals: List[str] - is_active: bool - name: str - type: str - viewer_id: int + points: List[Point3D] @dataclass @@ -67,13 +24,13 @@ class PointSetResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool name: str native_file: str - viewer_object_type: str + viewer_object_type: ViewerObjectType binary_light_viewable: Optional[str] = None collection_components: Optional[List[CollectionComponent]] = None crs: Optional[CRS] = None @@ -88,4 +45,4 @@ def __post_init__(self) -> None: response=PointSetResponse, ) -__all__ = ["Point", "PointSet", "PointSetResponse", "point_set_route"] +__all__ = ["Point3D", "PointSet", "PointSetResponse", "point_set_route"] diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.json b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.json index 3e2c0efb..93552bf5 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.json +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.json @@ -12,25 +12,7 @@ "points": { "type": "array", "items": { - "title": "PolygonalSurfacePoint", - "type": "object", - "properties": { - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "z": { - "type": "number" - } - }, - "required": [ - "x", - "y", - "z" - ], - "additionalProperties": false + "title": "Point3D" }, "minItems": 3 }, @@ -59,21 +41,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -87,116 +67,20 @@ "mesh_components": { "type": "array", "items": { - "type": "object", - "properties": { - "viewer_id": { - "type": "integer" - }, - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "boundaries": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "internals": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "viewer_id", - "geode_id", - "name", - "type", - "boundaries", - "internals", - "is_active" - ], - "additionalProperties": false + "title": "MeshComponent" } }, "collection_components": { "type": "array", "items": { - "type": "object", - "properties": { - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "geode_id", - "name", - "type", - "items", - "is_active" - ], - "additionalProperties": false + "title": "CollectionComponent" } }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py index 92bbb9d7..bcb9c117 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py @@ -1,3 +1,6 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -7,74 +10,28 @@ from typing import List -@dataclass -class PolygonalSurfacePoint(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - x: float - y: float - z: float - - @dataclass class PolygonalSurface(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) name: str - points: List[PolygonalSurfacePoint] + points: List[Point3D] polygons: List[List[int]] -@dataclass -class CollectionComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - geode_id: str - is_active: bool - items: List[str] - name: str - type: str - - -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - -@dataclass -class MeshComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - boundaries: List[str] - geode_id: str - internals: List[str] - is_active: bool - name: str - type: str - viewer_id: int - - @dataclass class PolygonalSurfaceResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool name: str native_file: str - viewer_object_type: str + viewer_object_type: ViewerObjectType binary_light_viewable: Optional[str] = None collection_components: Optional[List[CollectionComponent]] = None crs: Optional[CRS] = None @@ -89,4 +46,4 @@ def __post_init__(self) -> None: response=PolygonalSurfaceResponse, ) -__all__ = ["PolygonalSurfacePoint", "PolygonalSurface", "PolygonalSurfaceResponse", "polygonal_surface_route"] +__all__ = ["Point3D", "PolygonalSurface", "PolygonalSurfaceResponse", "polygonal_surface_route"] diff --git a/src/opengeodeweb_back/routes/crs/blueprint_crs.py b/src/opengeodeweb_back/routes/crs/blueprint_crs.py index 7e9a855a..275b41f5 100644 --- a/src/opengeodeweb_back/routes/crs/blueprint_crs.py +++ b/src/opengeodeweb_back/routes/crs/blueprint_crs.py @@ -20,6 +20,7 @@ load_crs_object, ) from opengeodeweb_back.routes.crs import schemas +from opengeodeweb_back.schema_types import CRS from opengeodeweb_back.typed_route import typed_route if TYPE_CHECKING: @@ -59,7 +60,7 @@ def _saved_response(data_id: str, data: Data, geode_object: CrsGeodeObject) -> d def geographic_list(params: schemas.GeographicList) -> schemas.GeographicListResponse: geode_object = geode_functions.geode_object_from_string(params.geode_object_type) crs_list = [ - schemas.geographic_list.CRSList(name=info.name, code=info.code, authority=info.authority) + CRS(name=info.name, code=info.code, authority=info.authority) for info in geographic_coordinate_systems(geode_object.is_3d()).values() ] return schemas.GeographicListResponse(crs_list=crs_list) @@ -73,9 +74,7 @@ def active(params: schemas.Active) -> schemas.ActiveResponse: crs_manager = geode_object.crs_manager() info = geographic_info(crs_manager) crs_info = ( - None - if info is None - else schemas.active.CRSInfo(authority=info.authority, code=info.code, name=info.name) + None if info is None else CRS(authority=info.authority, code=info.code, name=info.name) ) return schemas.ActiveResponse( crs_name=crs_manager.active_coordinate_reference_system_name(), diff --git a/src/opengeodeweb_back/routes/crs/schemas/active.json b/src/opengeodeweb_back/routes/crs/schemas/active.json index 45992366..e6298345 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/active.json +++ b/src/opengeodeweb_back/routes/crs/schemas/active.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -22,24 +20,7 @@ "type": "string" }, "crs_info": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/crs/schemas/active.py b/src/opengeodeweb_back/routes/crs/schemas/active.py index ebb997b1..75269a65 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/active.py +++ b/src/opengeodeweb_back/routes/crs/schemas/active.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import CRS from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Optional @@ -11,17 +13,7 @@ class Active(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class CRSInfo(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str + id: DataId @dataclass @@ -30,7 +22,7 @@ def __post_init__(self) -> None: print_dataclass(self) crs_name: str - crs_info: Optional[CRSInfo] = None + crs_info: Optional[CRS] = None active_route = Route( diff --git a/src/opengeodeweb_back/routes/crs/schemas/align.json b/src/opengeodeweb_back/routes/crs/schemas/align.json index ce6f290c..287f47bf 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/align.json +++ b/src/opengeodeweb_back/routes/crs/schemas/align.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "linked_ids": { "type": "array", "items": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "uniqueItems": true }, @@ -94,24 +90,7 @@ "type": "string" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "linked": { "type": "array", @@ -119,30 +98,13 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId" }, "binary_light_viewable": { "type": "string" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/crs/schemas/align.py b/src/opengeodeweb_back/routes/crs/schemas/align.py index 37eacd7f..3dc1ad00 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/align.py +++ b/src/opengeodeweb_back/routes/crs/schemas/align.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -32,11 +33,11 @@ def __post_init__(self) -> None: authority: str code: str - id: str + id: DataId name: str source_points: List[SourcePoint] target_points: List[TargetPoint] - linked_ids: Optional[List[str]] = None + linked_ids: Optional[List[DataId]] = None @dataclass @@ -64,7 +65,7 @@ class Linked(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId binary_light_viewable: Optional[str] = None crs: Optional[LinkedCRS] = None diff --git a/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.json b/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.json index 3fa9e3f4..4ad436aa 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.json +++ b/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "linked_ids": { "type": "array", "items": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "uniqueItems": true }, @@ -46,24 +42,7 @@ "type": "object", "properties": { "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "implausible": { "type": "boolean" @@ -74,27 +53,10 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "implausible": { "type": "boolean" diff --git a/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.py b/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.py index da90f98b..96a9cbbd 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.py +++ b/src/opengeodeweb_back/routes/crs/schemas/assign_geographic.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Optional, List @@ -14,9 +15,9 @@ def __post_init__(self) -> None: authority: str code: str - id: str + id: DataId name: str - linked_ids: Optional[List[str]] = None + linked_ids: Optional[List[DataId]] = None only_plausible: Optional[bool] = None @@ -45,7 +46,7 @@ class Linked(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId crs: Optional[LinkedCRS] = None implausible: Optional[bool] = None diff --git a/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.json b/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.json index 75453eb4..262a6f30 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.json +++ b/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "linked_ids": { "type": "array", "items": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "uniqueItems": true }, @@ -46,24 +42,7 @@ "type": "string" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "linked": { "type": "array", @@ -71,27 +50,10 @@ "type": "object", "properties": { "id": { - "type": "string" + "title": "DataId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" }, "binary_light_viewable": { "type": "string" diff --git a/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.py b/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.py index 7fb0af14..465c3446 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.py +++ b/src/opengeodeweb_back/routes/crs/schemas/convert_geographic.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Optional, List @@ -14,9 +15,9 @@ def __post_init__(self) -> None: authority: str code: str - id: str + id: DataId name: str - linked_ids: Optional[List[str]] = None + linked_ids: Optional[List[DataId]] = None @dataclass @@ -44,7 +45,7 @@ class Linked(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId binary_light_viewable: Optional[str] = None crs: Optional[LinkedCRS] = None diff --git a/src/opengeodeweb_back/routes/crs/schemas/geographic_list.json b/src/opengeodeweb_back/routes/crs/schemas/geographic_list.json index 21db718c..e9b72504 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/geographic_list.json +++ b/src/opengeodeweb_back/routes/crs/schemas/geographic_list.json @@ -6,8 +6,7 @@ "type": "object", "properties": { "geode_object_type": { - "type": "string", - "minLength": 1 + "title": "GeodeObjectType" } }, "required": [ @@ -20,24 +19,7 @@ "crs_list": { "type": "array", "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "code": { - "type": "string" - }, - "authority": { - "type": "string" - } - }, - "required": [ - "name", - "code", - "authority" - ], - "additionalProperties": false + "title": "CRS" } } }, @@ -46,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/crs/schemas/geographic_list.py b/src/opengeodeweb_back/routes/crs/schemas/geographic_list.py index d359497c..e3af1b35 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/geographic_list.py +++ b/src/opengeodeweb_back/routes/crs/schemas/geographic_list.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.database.data_types import GeodeObjectType +from opengeodeweb_back.schema_types import CRS from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,17 +13,7 @@ class GeographicList(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_object_type: str - - -@dataclass -class CRSList(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str + geode_object_type: GeodeObjectType @dataclass @@ -29,7 +21,7 @@ class GeographicListResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - crs_list: List[CRSList] + crs_list: List[CRS] geographic_list_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/allowed_objects.json b/src/opengeodeweb_back/routes/schemas/allowed_objects.json index 51dfd885..65aeff18 100644 --- a/src/opengeodeweb_back/routes/schemas/allowed_objects.json +++ b/src/opengeodeweb_back/routes/schemas/allowed_objects.json @@ -6,8 +6,7 @@ "type": "object", "properties": { "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ @@ -43,7 +42,7 @@ "objects_to_load": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType" } } }, @@ -53,4 +52,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/allowed_objects.py b/src/opengeodeweb_back/routes/schemas/allowed_objects.py index 135a2735..cde049f0 100644 --- a/src/opengeodeweb_back/routes/schemas/allowed_objects.py +++ b/src/opengeodeweb_back/routes/schemas/allowed_objects.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import Filename +from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Dict, List @@ -11,7 +13,7 @@ class AllowedObjects(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename @dataclass @@ -30,7 +32,7 @@ def __post_init__(self) -> None: print_dataclass(self) allowed_objects: Dict[str, AllowedObject] - objects_to_load: List[str] + objects_to_load: List[GeodeObjectType] allowed_objects_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/apply_time_series.json b/src/opengeodeweb_back/routes/schemas/apply_time_series.json index 49ac1619..b0111869 100644 --- a/src/opengeodeweb_back/routes/schemas/apply_time_series.json +++ b/src/opengeodeweb_back/routes/schemas/apply_time_series.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/apply_time_series.py b/src/opengeodeweb_back/routes/schemas/apply_time_series.py index d5b6222f..5657177b 100644 --- a/src/opengeodeweb_back/routes/schemas/apply_time_series.py +++ b/src/opengeodeweb_back/routes/schemas/apply_time_series.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import Filename +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -10,8 +12,8 @@ class ApplyTimeSeries(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str - id: str + filename: Filename + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.json b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.json index eef2c414..c0bafd95 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -21,31 +19,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -54,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py index 3d1a2a68..eb8de15e 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,18 +13,7 @@ class CellAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + id: DataId @dataclass @@ -30,7 +21,7 @@ class CellAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] cell_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.json b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.json index dd8759b4..686a420f 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py index 451483c5..bbcc0e6a 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class CellAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - id: str + attribute_name: AttributeName + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/data_missing_files.json b/src/opengeodeweb_back/routes/schemas/data_missing_files.json index c95ffe10..92fb7f5a 100644 --- a/src/opengeodeweb_back/routes/schemas/data_missing_files.json +++ b/src/opengeodeweb_back/routes/schemas/data_missing_files.json @@ -6,12 +6,10 @@ "type": "object", "properties": { "geode_object_type": { - "type": "string", - "minLength": 1 + "title": "GeodeObjectType" }, "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/data_missing_files.py b/src/opengeodeweb_back/routes/schemas/data_missing_files.py index 2669515f..e8f81973 100644 --- a/src/opengeodeweb_back/routes/schemas/data_missing_files.py +++ b/src/opengeodeweb_back/routes/schemas/data_missing_files.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import Filename +from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class DataMissingFiles(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str - geode_object_type: str + filename: Filename + geode_object_type: GeodeObjectType @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.json b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.json index 0732e15a..6fd90772 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -21,31 +19,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -54,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py index 3ef50f6a..05be560c 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,18 +13,7 @@ class EdgeAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + id: DataId @dataclass @@ -30,7 +21,7 @@ class EdgeAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] edge_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.json b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.json index 8b6697d9..f990b910 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py index ddda1cfd..84bab5f0 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class EdgeAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - id: str + attribute_name: AttributeName + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/export_project.json b/src/opengeodeweb_back/routes/schemas/export_project.json index fdcf9c9b..0fdf1bd9 100644 --- a/src/opengeodeweb_back/routes/schemas/export_project.json +++ b/src/opengeodeweb_back/routes/schemas/export_project.json @@ -9,8 +9,7 @@ "type": "object" }, "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ @@ -21,4 +20,4 @@ "response": { "format": "binary" } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/export_project.py b/src/opengeodeweb_back/routes/schemas/export_project.py index 78edc3d6..adc4fbf7 100644 --- a/src/opengeodeweb_back/routes/schemas/export_project.py +++ b/src/opengeodeweb_back/routes/schemas/export_project.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import BinaryResponse, Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,7 +12,7 @@ class ExportProject(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename snapshot: Dict[str, Any] diff --git a/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.json b/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.json index e933c59e..b9cb63a5 100644 --- a/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.json +++ b/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.json @@ -6,8 +6,7 @@ "type": "object", "properties": { "geode_object_type": { - "type": "string", - "minLength": 1 + "title": "GeodeObjectType" } }, "required": [ @@ -20,13 +19,13 @@ "parents": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType" } }, "children": { "type": "array", "items": { - "type": "string" + "title": "GeodeObjectType" } } }, @@ -36,4 +35,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.py b/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.py index 3d971758..da05441f 100644 --- a/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.py +++ b/src/opengeodeweb_back/routes/schemas/geode_object_inheritance.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class GeodeObjectInheritance(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_object_type: str + geode_object_type: GeodeObjectType @dataclass @@ -19,8 +20,8 @@ class GeodeObjectInheritanceResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - children: List[str] - parents: List[str] + children: List[GeodeObjectType] + parents: List[GeodeObjectType] geode_object_inheritance_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json b/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json index b35f5e9f..9180ad48 100644 --- a/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json +++ b/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json @@ -6,12 +6,10 @@ "type": "object", "properties": { "geode_object_type": { - "type": "string", - "minLength": 1 + "title": "GeodeObjectType" }, "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ @@ -37,4 +35,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py b/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py index eeda1ded..ea3cf144 100644 --- a/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py +++ b/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import Filename +from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Dict @@ -11,8 +13,8 @@ class GeodeObjectsAndOutputExtensions(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str - geode_object_type: str + filename: Filename + geode_object_type: GeodeObjectType @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/horizon_stack_info.json b/src/opengeodeweb_back/routes/schemas/horizon_stack_info.json index adf7761f..7a281215 100644 --- a/src/opengeodeweb_back/routes/schemas/horizon_stack_info.json +++ b/src/opengeodeweb_back/routes/schemas/horizon_stack_info.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -24,9 +22,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "name": { "type": "string" @@ -45,9 +41,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "name": { "type": "string" diff --git a/src/opengeodeweb_back/routes/schemas/horizon_stack_info.py b/src/opengeodeweb_back/routes/schemas/horizon_stack_info.py index ce260d58..a89f4bd2 100644 --- a/src/opengeodeweb_back/routes/schemas/horizon_stack_info.py +++ b/src/opengeodeweb_back/routes/schemas/horizon_stack_info.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class HorizonStackInfo(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass @@ -19,7 +20,7 @@ class Horizon(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: GeodeId name: str @@ -28,7 +29,7 @@ class Unit(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: GeodeId name: str diff --git a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.json b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.json index e65607a4..c8f52aa1 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 } @@ -31,31 +27,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -64,4 +36,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.py b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.py index dccd6ac8..040fba15 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,19 +13,8 @@ class ModelComponentEdgeAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + component_ids: List[GeodeId] + id: DataId @dataclass @@ -31,7 +22,7 @@ class ModelComponentEdgeAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] model_component_edge_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.json b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.json index 47f85ffc..bf184b57 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.json @@ -6,22 +6,17 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.py b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.py index f76be3d6..1236947f 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +13,9 @@ class ModelComponentEdgeAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - component_ids: List[str] - id: str + attribute_name: AttributeName + component_ids: List[GeodeId] + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.json b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.json index 78a689d2..bfe7f05f 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 } @@ -31,31 +27,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -64,4 +36,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.py b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.py index 4f236a5f..6fac784b 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,19 +13,8 @@ class ModelComponentPolygonAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + component_ids: List[GeodeId] + id: DataId @dataclass @@ -31,7 +22,7 @@ class ModelComponentPolygonAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] model_component_polygon_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.json b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.json index 58947df0..0353213e 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.json @@ -6,22 +6,17 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.py b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.py index 767b98c7..584f8ab4 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +13,9 @@ class ModelComponentPolygonAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - component_ids: List[str] - id: str + attribute_name: AttributeName + component_ids: List[GeodeId] + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.json b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.json index a7abf0f0..987caaa7 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 } @@ -31,31 +27,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -64,4 +36,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.py b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.py index 39d726d9..cc3e0574 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,19 +13,8 @@ class ModelComponentPolyhedronAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + component_ids: List[GeodeId] + id: DataId @dataclass @@ -31,7 +22,7 @@ class ModelComponentPolyhedronAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] model_component_polyhedron_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.json b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.json index 7909bf04..f851c275 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.json @@ -6,22 +6,17 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.py b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.py index 14b9713c..be4da6a0 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +13,9 @@ class ModelComponentPolyhedronAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - component_ids: List[str] - id: str + attribute_name: AttributeName + component_ids: List[GeodeId] + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.json b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.json index 82f1c2d5..8b279b33 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.json @@ -6,16 +6,12 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 } @@ -31,31 +27,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -64,4 +36,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.py b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.py index 5b54a9a3..c64fc22b 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,19 +13,8 @@ class ModelComponentVertexAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + component_ids: List[GeodeId] + id: DataId @dataclass @@ -31,7 +22,7 @@ class ModelComponentVertexAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] model_component_vertex_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.json b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.json index 74fa7ecd..e81c7483 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.json @@ -6,22 +6,17 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "component_ids": { "type": "array", "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "minItems": 1 }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.py b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.py index 216632c5..6385f12e 100644 --- a/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +13,9 @@ class ModelComponentVertexAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - component_ids: List[str] - id: str + attribute_name: AttributeName + component_ids: List[GeodeId] + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json index e8bcd583..e46164cb 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -21,31 +19,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -54,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py index e7d61189..31c818db 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,18 +13,7 @@ class PolygonAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + id: DataId @dataclass @@ -30,7 +21,7 @@ class PolygonAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] polygon_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.json b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.json index 03121368..0ff8db06 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py index fc5335f0..0c76afe2 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class PolygonAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - id: str + attribute_name: AttributeName + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json index 5ee60594..649a384c 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -21,31 +19,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -54,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py index ddc5f577..f8b7f8fe 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,18 +13,7 @@ class PolyhedronAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + id: DataId @dataclass @@ -30,7 +21,7 @@ class PolyhedronAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] polyhedron_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.json b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.json index f54c877a..13e8c177 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py index a9a4e9f3..bd91f0aa 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class PolyhedronAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - id: str + attribute_name: AttributeName + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/save_viewable_file.json b/src/opengeodeweb_back/routes/schemas/save_viewable_file.json index 41c4b9c5..8ce82bc4 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.json +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.json @@ -6,12 +6,10 @@ "type": "object", "properties": { "geode_object_type": { - "type": "string", - "minLength": 1 + "title": "GeodeObjectType" }, "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ @@ -32,21 +30,19 @@ "type": "string" }, "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "name": { "type": "string" }, "viewer_object_type": { - "type": "string" + "title": "ViewerObjectType" }, "is_viewable": { "type": "boolean" }, "geode_object_type": { - "type": "string" + "title": "GeodeObjectType" }, "viewable_file": { "type": "string" @@ -60,116 +56,20 @@ "mesh_components": { "type": "array", "items": { - "type": "object", - "properties": { - "viewer_id": { - "type": "integer" - }, - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "boundaries": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "internals": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "viewer_id", - "geode_id", - "name", - "type", - "boundaries", - "internals", - "is_active" - ], - "additionalProperties": false + "title": "MeshComponent" } }, "collection_components": { "type": "array", "items": { - "type": "object", - "properties": { - "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "minLength": 36, - "maxLength": 36 - } - }, - "is_active": { - "type": "boolean" - } - }, - "required": [ - "geode_id", - "name", - "type", - "items", - "is_active" - ], - "additionalProperties": false + "title": "CollectionComponent" } }, "geode_id": { - "type": "string", - "minLength": 36, - "maxLength": 36 + "title": "GeodeId" }, "crs": { - "type": "object", - "properties": { - "authority": { - "type": "string" - }, - "code": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "authority", - "code", - "name" - ], - "additionalProperties": false + "title": "CRS" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py index 7409ee8c..2db115e7 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,3 +1,6 @@ +from opengeodeweb_back.schema_types import CRS, CollectionComponent, Filename, MeshComponent, ViewerId +from opengeodeweb_microservice.schema_types import DataId, GeodeId +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -11,44 +14,8 @@ class SaveViewableFile(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str - geode_object_type: str - - -@dataclass -class CollectionComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - geode_id: str - is_active: bool - items: List[str] - name: str - type: str - - -@dataclass -class CRS(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - -@dataclass -class MeshComponent(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - boundaries: List[str] - geode_id: str - internals: List[str] - is_active: bool - name: str - type: str - viewer_id: int + filename: Filename + geode_object_type: GeodeObjectType @dataclass @@ -56,13 +23,13 @@ class SaveViewableFileItem(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str - geode_object_type: str - id: str + geode_id: GeodeId + geode_object_type: GeodeObjectType + id: DataId is_viewable: bool name: str native_file: str - viewer_object_type: str + viewer_object_type: ViewerObjectType binary_light_viewable: Optional[str] = None collection_components: Optional[List[CollectionComponent]] = None crs: Optional[CRS] = None diff --git a/src/opengeodeweb_back/routes/schemas/texture_coordinates.json b/src/opengeodeweb_back/routes/schemas/texture_coordinates.json index 49ab2ceb..1c781c32 100644 --- a/src/opengeodeweb_back/routes/schemas/texture_coordinates.json +++ b/src/opengeodeweb_back/routes/schemas/texture_coordinates.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -30,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/texture_coordinates.py b/src/opengeodeweb_back/routes/schemas/texture_coordinates.py index 85442dc9..2d92f661 100644 --- a/src/opengeodeweb_back/routes/schemas/texture_coordinates.py +++ b/src/opengeodeweb_back/routes/schemas/texture_coordinates.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class TextureCoordinates(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.json b/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.json index 4b84d5f5..ad10753c 100644 --- a/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.json +++ b/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.json @@ -6,8 +6,7 @@ "type": "object", "properties": { "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ @@ -29,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.py b/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.py index dc07b88e..5e18ddc0 100644 --- a/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.py +++ b/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class TimeSeriesAllowedObjects(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/time_series_missing_files.json b/src/opengeodeweb_back/routes/schemas/time_series_missing_files.json index 9d0f1a29..a5eeef8f 100644 --- a/src/opengeodeweb_back/routes/schemas/time_series_missing_files.json +++ b/src/opengeodeweb_back/routes/schemas/time_series_missing_files.json @@ -6,8 +6,7 @@ "type": "object", "properties": { "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/time_series_missing_files.py b/src/opengeodeweb_back/routes/schemas/time_series_missing_files.py index 4f36641f..d8d53f42 100644 --- a/src/opengeodeweb_back/routes/schemas/time_series_missing_files.py +++ b/src/opengeodeweb_back/routes/schemas/time_series_missing_files.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class TimeSeriesMissingFiles(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/upload_file.json b/src/opengeodeweb_back/routes/schemas/upload_file.json index 4f414a71..a808cb4b 100644 --- a/src/opengeodeweb_back/routes/schemas/upload_file.json +++ b/src/opengeodeweb_back/routes/schemas/upload_file.json @@ -7,8 +7,7 @@ "type": "object", "properties": { "filename": { - "type": "string", - "minLength": 1 + "title": "Filename" } }, "additionalProperties": false, @@ -24,4 +23,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/upload_file.py b/src/opengeodeweb_back/routes/schemas/upload_file.py index 200a177e..1b30bd37 100644 --- a/src/opengeodeweb_back/routes/schemas/upload_file.py +++ b/src/opengeodeweb_back/routes/schemas/upload_file.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,7 +12,7 @@ class UploadFile(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: Optional[str] = None + filename: Optional[Filename] = None @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/validate.json b/src/opengeodeweb_back/routes/schemas/validate.json index 8be97456..0ddf9680 100644 --- a/src/opengeodeweb_back/routes/schemas/validate.json +++ b/src/opengeodeweb_back/routes/schemas/validate.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -38,4 +36,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/validate.py b/src/opengeodeweb_back/routes/schemas/validate.py index d3bdbc77..92840ee6 100644 --- a/src/opengeodeweb_back/routes/schemas/validate.py +++ b/src/opengeodeweb_back/routes/schemas/validate.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,7 +12,7 @@ class Validate(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json index f7a557e2..d7e6114a 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.json @@ -6,9 +6,7 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" } }, "required": [ @@ -21,31 +19,7 @@ "attributes": { "type": "array", "items": { - "type": "object", - "properties": { - "attribute_name": { - "type": "string" - }, - "attribute_id": { - "type": "string" - }, - "nb_items": { - "type": "integer" - }, - "time_steps": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": [ - "attribute_name", - "attribute_id", - "nb_items", - "time_steps" - ], - "additionalProperties": false + "title": "AttributeInfo" } } }, @@ -54,4 +28,4 @@ ], "additionalProperties": false } -} \ No newline at end of file +} diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py index 05839462..01a588f8 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId +from opengeodeweb_back.schema_types import AttributeInfo, AttributeName from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,18 +13,7 @@ class VertexAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str - - -@dataclass -class Attribute(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - attribute_id: str - attribute_name: str - nb_items: int - time_steps: List[float] + id: DataId @dataclass @@ -30,7 +21,7 @@ class VertexAttributeNamesResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attributes: List[Attribute] + attributes: List[AttributeInfo] vertex_attribute_names_route = Route( diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.json b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.json index 2458a211..f4b6c68a 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.json +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.json @@ -6,13 +6,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "minLength": 32, - "maxLength": 32 + "title": "DataId" }, "attribute_name": { - "type": "string", - "minLength": 1 + "title": "AttributeName" } }, "required": [ diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py index d8d0e1cf..ad4ab0de 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py @@ -1,3 +1,5 @@ +from opengeodeweb_back.schema_types import AttributeName +from opengeodeweb_microservice.schema_types import DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +13,8 @@ class VertexAttributeRange(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - attribute_name: str - id: str + attribute_name: AttributeName + id: DataId @dataclass diff --git a/src/opengeodeweb_back/schema_definitions.json b/src/opengeodeweb_back/schema_definitions.json new file mode 100644 index 00000000..4a18cd72 --- /dev/null +++ b/src/opengeodeweb_back/schema_definitions.json @@ -0,0 +1,305 @@ +{ + "AttributeInfo": { + "type": "object", + "properties": { + "attribute_name": { + "title": "AttributeName", + "type": "string", + "minLength": 1 + }, + "attribute_id": { + "type": "string" + }, + "nb_items": { + "type": "integer" + }, + "time_steps": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "attribute_name", + "attribute_id", + "nb_items", + "time_steps" + ], + "additionalProperties": false + }, + "AttributeName": { + "type": "string", + "minLength": 1 + }, + "CRS": { + "type": "object", + "properties": { + "authority": { + "type": "string", + "minLength": 1 + }, + "code": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "authority", + "code", + "name" + ], + "additionalProperties": false + }, + "CollectionComponent": { + "type": "object", + "properties": { + "geode_id": { + "title": "GeodeId", + "type": "string", + "minLength": 36, + "maxLength": 36 + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "title": "GeodeId", + "type": "string", + "minLength": 36, + "maxLength": 36 + } + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "geode_id", + "name", + "type", + "items", + "is_active" + ], + "additionalProperties": false + }, + "DataId": { + "type": "string", + "minLength": 32, + "maxLength": 32 + }, + "Filename": { + "type": "string", + "minLength": 1 + }, + "GeodeEdgeMeshType": { + "type": "string", + "enum": [ + "EdgedCurve2D", + "EdgedCurve3D" + ] + }, + "GeodeId": { + "type": "string", + "minLength": 36, + "maxLength": 36 + }, + "GeodeMeshType": { + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D" + ] + }, + "GeodeModelType": { + "type": "string", + "enum": [ + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] + }, + "GeodeObjectType": { + "type": "string", + "enum": [ + "VertexSet", + "Graph", + "PointSet2D", + "PointSet3D", + "EdgedCurve2D", + "EdgedCurve3D", + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D", + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D", + "BRep", + "Section", + "StructuralModel", + "CrossSection", + "ImplicitStructuralModel", + "ImplicitCrossSection", + "HorizonStack3D" + ] + }, + "GeodePointMeshType": { + "type": "string", + "enum": [ + "PointSet2D", + "PointSet3D" + ] + }, + "GeodePolygonMeshType": { + "type": "string", + "enum": [ + "RasterImage2D", + "PolygonalSurface2D", + "PolygonalSurface3D", + "TriangulatedSurface2D", + "TriangulatedSurface3D", + "RegularGrid2D", + "LightRegularGrid2D" + ] + }, + "GeodePolyhedronMeshType": { + "type": "string", + "enum": [ + "RasterImage3D", + "PolyhedralSolid3D", + "TetrahedralSolid3D", + "HybridSolid3D", + "RegularGrid3D", + "LightRegularGrid3D" + ] + }, + "MeshComponent": { + "type": "object", + "properties": { + "viewer_id": { + "title": "ViewerId", + "type": "integer" + }, + "geode_id": { + "title": "GeodeId", + "type": "string", + "minLength": 36, + "maxLength": 36 + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "boundaries": { + "type": "array", + "items": { + "title": "GeodeId", + "type": "string", + "minLength": 36, + "maxLength": 36 + } + }, + "internals": { + "type": "array", + "items": { + "title": "GeodeId", + "type": "string", + "minLength": 36, + "maxLength": 36 + } + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "viewer_id", + "geode_id", + "name", + "type", + "boundaries", + "internals", + "is_active" + ], + "additionalProperties": false + }, + "Point3D": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "ViewerElementsType": { + "type": "string", + "enum": [ + "points", + "edges", + "polygons", + "polyhedra", + "default" + ] + }, + "ViewerId": { + "type": "integer" + }, + "ViewerObjectType": { + "type": "string", + "enum": [ + "mesh", + "model" + ] + } +} diff --git a/src/opengeodeweb_back/schema_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts new file mode 100644 index 00000000..7cc8de14 --- /dev/null +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -0,0 +1,44 @@ +// Generated by generate_schema_types.js from schema_types.json: do not edit + +export type ViewerId = number; +export type AttributeName = string; +export type Filename = string; + +import type { GeodeId } from "@geode/opengeodeweb-microservice/schema_types"; + +export interface Point3D { + x: number; + y: number; + z: number; +} + +export interface AttributeInfo { + attribute_id: string; + attribute_name: AttributeName; + nb_items: number; + time_steps: number[]; +} + +export interface CRS { + authority: string; + code: string; + name: string; +} + +export interface MeshComponent { + boundaries: GeodeId[]; + geode_id: GeodeId; + internals: GeodeId[]; + is_active: boolean; + name: string; + type: string; + viewer_id: ViewerId; +} + +export interface CollectionComponent { + geode_id: GeodeId; + is_active: boolean; + items: GeodeId[]; + name: string; + type: string; +} diff --git a/src/opengeodeweb_back/schema_types.json b/src/opengeodeweb_back/schema_types.json new file mode 100644 index 00000000..a9c7bc50 --- /dev/null +++ b/src/opengeodeweb_back/schema_types.json @@ -0,0 +1,156 @@ +{ + "ViewerId": { + "type": "integer" + }, + "AttributeName": { + "type": "string", + "minLength": 1 + }, + "Filename": { + "type": "string", + "minLength": 1 + }, + "Point3D": { + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + }, + "required": [ + "x", + "y", + "z" + ], + "additionalProperties": false + }, + "AttributeInfo": { + "type": "object", + "properties": { + "attribute_name": { + "title": "AttributeName" + }, + "attribute_id": { + "type": "string" + }, + "nb_items": { + "type": "integer" + }, + "time_steps": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "attribute_name", + "attribute_id", + "nb_items", + "time_steps" + ], + "additionalProperties": false + }, + "CRS": { + "type": "object", + "properties": { + "authority": { + "type": "string", + "minLength": 1 + }, + "code": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "authority", + "code", + "name" + ], + "additionalProperties": false + }, + "MeshComponent": { + "type": "object", + "properties": { + "viewer_id": { + "title": "ViewerId" + }, + "geode_id": { + "title": "GeodeId" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "boundaries": { + "type": "array", + "items": { + "title": "GeodeId" + } + }, + "internals": { + "type": "array", + "items": { + "title": "GeodeId" + } + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "viewer_id", + "geode_id", + "name", + "type", + "boundaries", + "internals", + "is_active" + ], + "additionalProperties": false + }, + "CollectionComponent": { + "type": "object", + "properties": { + "geode_id": { + "title": "GeodeId" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "title": "GeodeId" + } + }, + "is_active": { + "type": "boolean" + } + }, + "required": [ + "geode_id", + "name", + "type", + "items", + "is_active" + ], + "additionalProperties": false + } +} diff --git a/src/opengeodeweb_back/schema_types.py b/src/opengeodeweb_back/schema_types.py new file mode 100644 index 00000000..8a4cce59 --- /dev/null +++ b/src/opengeodeweb_back/schema_types.py @@ -0,0 +1,82 @@ +"""Generated by generate_schema_types.js from schema_types.json: do not edit""" + +# ruff: noqa: TC002 + +from dataclasses import dataclass + +from dataclasses_json import DataClassJsonMixin +from opengeodeweb_microservice.schema_types import GeodeId +from opengeodeweb_microservice.schemas import print_dataclass + +ViewerId = int +AttributeName = str +Filename = str + + +@dataclass +class Point3D(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + x: float + y: float + z: float + + +@dataclass +class AttributeInfo(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + attribute_id: str + attribute_name: AttributeName + nb_items: int + time_steps: list[float] + + +@dataclass +class CRS(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + authority: str + code: str + name: str + + +@dataclass +class MeshComponent(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + boundaries: list[GeodeId] + geode_id: GeodeId + internals: list[GeodeId] + is_active: bool + name: str + type: str + viewer_id: ViewerId + + +@dataclass +class CollectionComponent(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + geode_id: GeodeId + is_active: bool + items: list[GeodeId] + name: str + type: str + + +__all__ = [ + "CRS", + "AttributeInfo", + "AttributeName", + "CollectionComponent", + "Filename", + "MeshComponent", + "Point3D", + "ViewerId", +] diff --git a/tests/test_routes.py b/tests/test_routes.py index f9b0b051..42fd24ba 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -516,6 +516,10 @@ def test_geode_object_inheritance(client: FlaskClient) -> None: # Parent assert "VertexSet" in parents + # Not a GeodeObjectType: rejected by the enum of the schema + response = client.post(route, json={"geode_object_type": "NotAGeodeObject"}) + assert response.status_code == 400 + # Test all params def get_full_data() -> test_utils.JsonData: return {"geode_object_type": "BRep"}