From 751954adafb25858f8067462cbb3f20fb6aaf94f Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 15:15:14 +0100 Subject: [PATCH 1/7] fix(schemas): define CRS, AttributeInfo and the model components They are only used by this package and the ones depending on it, which import them from @geode/opengeodeweb-back/schema_types or opengeodeweb_back.schema_types. Co-Authored-By: Claude Opus 5.5 --- package.json | 8 +- src/opengeodeweb_back/schema_types.d.ts | 32 ++++++++ src/opengeodeweb_back/schema_types.json | 102 ++++++++++++++++++++++++ src/opengeodeweb_back/schema_types.py | 61 ++++++++++++++ 4 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/opengeodeweb_back/schema_types.d.ts create mode 100644 src/opengeodeweb_back/schema_types.json create mode 100644 src/opengeodeweb_back/schema_types.py 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/src/opengeodeweb_back/schema_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts new file mode 100644 index 00000000..4cf95636 --- /dev/null +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -0,0 +1,32 @@ +// Generated by generate_schema_types.js from schema_types.json: do not edit + +export interface AttributeInfo { + attribute_id: string; + attribute_name: string; + nb_items: number; + time_steps: number[]; +} + +export interface CRS { + authority: string; + code: string; + name: string; +} + +export interface MeshComponent { + boundaries: string[]; + geode_id: string; + internals: string[]; + is_active: boolean; + name: string; + type: string; + viewer_id: number; +} + +export interface CollectionComponent { + geode_id: string; + is_active: boolean; + items: string[]; + 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..eb2cf02b --- /dev/null +++ b/src/opengeodeweb_back/schema_types.json @@ -0,0 +1,102 @@ +{ + "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..3449743f --- /dev/null +++ b/src/opengeodeweb_back/schema_types.py @@ -0,0 +1,61 @@ +"""Generated by generate_schema_types.js from schema_types.json: do not edit""" + +from dataclasses import dataclass + +from dataclasses_json import DataClassJsonMixin +from opengeodeweb_microservice.schemas import print_dataclass + + +@dataclass +class AttributeInfo(DataClassJsonMixin): + def __post_init__(self) -> None: + print_dataclass(self) + + attribute_id: str + attribute_name: str + 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[str] + geode_id: str + internals: list[str] + is_active: bool + name: str + type: str + viewer_id: 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 + + +__all__ = [ + "CRS", + "AttributeInfo", + "CollectionComponent", + "MeshComponent", +] From 0fdfaccac3e5646c7930dddfd0b96080ef0df242 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 15:15:20 +0100 Subject: [PATCH 2/7] fix(schemas): route schemas only name the shared types they use geode_object_type is now validated against the values of GeodeObjectType. Co-Authored-By: Claude Opus 5.5 --- opengeodeweb_back_schemas.json | 801 ++++++++++++++++-- opengeodeweb_back_typed_schemas.d.ts | 379 ++------- pyproject.toml | 2 +- .../routes/basemap/schemas/build.json | 94 +- .../routes/basemap/schemas/build.py | 30 +- .../routes/basemap/schemas/delete.json | 6 +- .../routes/create/schemas/edged_curve.json | 132 +-- .../routes/create/schemas/edged_curve.py | 57 +- .../routes/create/schemas/horizon_stack.json | 112 +-- .../routes/create/schemas/horizon_stack.py | 42 +- .../routes/create/schemas/point_set.json | 131 +-- .../routes/create/schemas/point_set.py | 57 +- .../create/schemas/polygonal_surface.json | 132 +-- .../create/schemas/polygonal_surface.py | 57 +- .../routes/crs/schemas/active.json | 23 +- .../routes/crs/schemas/active.py | 13 +- .../routes/crs/schemas/align.json | 48 +- .../routes/crs/schemas/assign_geographic.json | 48 +- .../crs/schemas/convert_geographic.json | 48 +- .../routes/crs/schemas/geographic_list.json | 24 +- .../routes/crs/schemas/geographic_list.py | 16 +- .../routes/schemas/allowed_objects.json | 7 +- .../routes/schemas/allowed_objects.py | 3 +- .../routes/schemas/apply_time_series.json | 7 +- .../routes/schemas/cell_attribute_names.json | 32 +- .../routes/schemas/cell_attribute_names.py | 14 +- .../routes/schemas/cell_attribute_range.json | 7 +- .../routes/schemas/data_missing_files.json | 6 +- .../routes/schemas/data_missing_files.py | 3 +- .../routes/schemas/edge_attribute_names.json | 32 +- .../routes/schemas/edge_attribute_names.py | 14 +- .../routes/schemas/edge_attribute_range.json | 7 +- .../routes/schemas/export_project.json | 5 +- .../schemas/geode_object_inheritance.json | 9 +- .../schemas/geode_object_inheritance.py | 7 +- .../geode_objects_and_output_extensions.json | 8 +- .../geode_objects_and_output_extensions.py | 3 +- .../routes/schemas/horizon_stack_info.json | 12 +- .../model_component_edge_attribute_names.json | 36 +- .../model_component_edge_attribute_names.py | 14 +- .../model_component_edge_attribute_range.json | 11 +- ...del_component_polygon_attribute_names.json | 36 +- ...model_component_polygon_attribute_names.py | 14 +- ...del_component_polygon_attribute_range.json | 11 +- ..._component_polyhedron_attribute_names.json | 36 +- ...el_component_polyhedron_attribute_names.py | 14 +- ..._component_polyhedron_attribute_range.json | 11 +- ...odel_component_vertex_attribute_names.json | 36 +- .../model_component_vertex_attribute_names.py | 14 +- ...odel_component_vertex_attribute_range.json | 11 +- .../schemas/polygon_attribute_names.json | 32 +- .../routes/schemas/polygon_attribute_names.py | 14 +- .../schemas/polygon_attribute_range.json | 7 +- .../schemas/polyhedron_attribute_names.json | 32 +- .../schemas/polyhedron_attribute_names.py | 14 +- .../schemas/polyhedron_attribute_range.json | 7 +- .../routes/schemas/save_viewable_file.json | 118 +-- .../routes/schemas/save_viewable_file.py | 44 +- .../routes/schemas/texture_coordinates.json | 6 +- .../schemas/time_series_allowed_objects.json | 5 +- .../schemas/time_series_missing_files.json | 3 +- .../routes/schemas/upload_file.json | 5 +- .../routes/schemas/validate.json | 6 +- .../schemas/vertex_attribute_names.json | 32 +- .../routes/schemas/vertex_attribute_names.py | 14 +- .../schemas/vertex_attribute_range.json | 7 +- src/opengeodeweb_back/schema_definitions.json | 305 +++++++ tests/test_routes.py | 4 + 68 files changed, 1341 insertions(+), 1986 deletions(-) create mode 100644 src/opengeodeweb_back/schema_definitions.json 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..d8eb9b20 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -1,6 +1,10 @@ // Generated by opengeodeweb-microservice-generate, do not edit. import type json from "./opengeodeweb_back_schemas.json"; +import type { AttributeInfo, CRS, CollectionComponent, MeshComponent } from "@geode/opengeodeweb-back/schema_types"; +import type { Point3D } from "@geode/opengeodeweb-microservice/schema_types"; +import type { GeodeObjectType, ViewerObjectType } from "@geode/opengeodeweb-microservice/data_types"; + export interface BasemapDeleteParams { id: string; } @@ -11,7 +15,7 @@ export interface BasemapDeleteResponse { 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,9 +36,9 @@ export interface BasemapBuildResponse { binary_light_viewable?: string; bounds: MeshBounds; columns: number; - crs?: BasemapBuildResponseCRS; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; is_viewable: boolean; maps: MapElement[]; @@ -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; + collection_components?: CollectionComponent[]; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; 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; + collection_components?: CollectionComponent[]; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; 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,108 +114,48 @@ export interface CreateHorizonStackParams { export interface CreateHorizonStackResponse { binary_light_viewable?: string; - collection_components?: CreateHorizonStackResponseCollectionComponent[]; - crs?: CreateHorizonStackResponseCRS; + collection_components?: CollectionComponent[]; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; 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; + collection_components?: CollectionComponent[]; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; 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 { @@ -296,28 +168,16 @@ export interface CRSConvertGeographicParams { 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; + crs?: CRS; id: string; } -export interface PurpleCRS { - authority: string; - code: string; - name: string; -} - export interface CRSAssignGeographicParams { authority: string; code: string; @@ -328,29 +188,17 @@ export interface CRSAssignGeographicParams { } 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; + crs?: CRS; id: string; implausible?: boolean; } -export interface FluffyCRS { - authority: string; - code: string; - name: string; -} - export interface CRSAlignParams { authority: string; code: string; @@ -374,43 +222,25 @@ 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; + crs?: CRS; id: string; } -export interface TentacledCRS { - authority: string; - code: string; - name: string; -} - export interface CRSActiveParams { id: string; } 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; @@ -427,14 +257,7 @@ export interface VertexAttributeNamesParams { } 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 { @@ -483,7 +306,7 @@ export interface TextureCoordinatesResponse { export interface SaveViewableFileParams { filename: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; } export interface SaveViewableFileResponse { @@ -492,42 +315,18 @@ export interface SaveViewableFileResponse { export interface SaveViewableFileItem { binary_light_viewable?: string; - collection_components?: DatumCollectionComponent[]; - crs?: DatumCRS; + collection_components?: CollectionComponent[]; + crs?: CRS; geode_id: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; id: string; 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 { @@ -546,14 +345,7 @@ export interface PolyhedronAttributeNamesParams { } 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 { @@ -572,14 +364,7 @@ export interface PolygonAttributeNamesParams { } 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 { @@ -607,14 +392,7 @@ export interface ModelComponentVertexAttributeNamesParams { } 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 { @@ -635,14 +413,7 @@ export interface ModelComponentPolyhedronAttributeNamesParams { } 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 { @@ -663,14 +434,7 @@ export interface ModelComponentPolygonAttributeNamesParams { } 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 { @@ -691,14 +455,7 @@ export interface ModelComponentEdgeAttributeNamesParams { } 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 { @@ -736,7 +493,7 @@ export interface Unit { export interface GeodeObjectsAndOutputExtensionsParams { filename: string; - geode_object_type: string; + geode_object_type: GeodeObjectType; } export interface GeodeObjectsAndOutputExtensionsResponse { @@ -744,12 +501,12 @@ 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 { @@ -773,19 +530,12 @@ export interface EdgeAttributeNamesParams { } 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; + geode_object_type: GeodeObjectType; } export interface DataMissingFilesResponse { @@ -810,14 +560,7 @@ export interface CellAttributeNamesParams { } 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 { @@ -834,7 +577,7 @@ export interface AllowedObjectsParams { export interface AllowedObjectsResponse { allowed_objects: { [key: string]: AllowedObject }; - objects_to_load: string[]; + objects_to_load: GeodeObjectType[]; } export interface AllowedObject { 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/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..8170c38e 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/build.py +++ b/src/opengeodeweb_back/routes/basemap/schemas/build.py @@ -1,3 +1,5 @@ +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 +20,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 +32,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 +50,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: @@ -86,14 +68,14 @@ def __post_init__(self) -> None: bounds: MeshBounds columns: int geode_id: str - geode_object_type: str + geode_object_type: GeodeObjectType id: str 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 +89,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/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..0eff3089 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.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_microservice.schema_types import Point3D +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent 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 @@ -69,12 +26,12 @@ def __post_init__(self) -> None: print_dataclass(self) geode_id: str - geode_object_type: str + geode_object_type: GeodeObjectType id: str 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..577deb38 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -17,54 +19,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 + geode_object_type: GeodeObjectType id: str 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..db716f27 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.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_microservice.schema_types import Point3D +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent 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 @@ -68,12 +25,12 @@ def __post_init__(self) -> None: print_dataclass(self) geode_id: str - geode_object_type: str + geode_object_type: GeodeObjectType id: str 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..eb7f0bfb 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.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_microservice.schema_types import Point3D +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent 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 + geode_object_type: GeodeObjectType id: str 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/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..087d7266 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/active.py +++ b/src/opengeodeweb_back/routes/crs/schemas/active.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import CRS from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Optional @@ -14,23 +15,13 @@ def __post_init__(self) -> None: id: str -@dataclass -class CRSInfo(DataClassJsonMixin): - def __post_init__(self) -> None: - print_dataclass(self) - - authority: str - code: str - name: str - - @dataclass class ActiveResponse(DataClassJsonMixin): 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/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/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/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..445fc3dd 100644 --- a/src/opengeodeweb_back/routes/schemas/allowed_objects.py +++ b/src/opengeodeweb_back/routes/schemas/allowed_objects.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 Dict, List @@ -30,7 +31,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/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..ad065537 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -14,23 +15,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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..c8b1df72 100644 --- a/src/opengeodeweb_back/routes/schemas/data_missing_files.py +++ b/src/opengeodeweb_back/routes/schemas/data_missing_files.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 @@ -12,7 +13,7 @@ def __post_init__(self) -> None: print_dataclass(self) filename: str - geode_object_type: str + 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..c3a69be9 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -14,23 +15,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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/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..abf0033e 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,4 @@ +from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import Dict @@ -12,7 +13,7 @@ def __post_init__(self) -> None: print_dataclass(self) filename: str - geode_object_type: str + 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/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..906b68a2 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,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -15,23 +16,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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_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..eb378d54 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,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -15,23 +16,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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_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..178c81f9 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,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -15,23 +16,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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_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..108d76a9 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,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -15,23 +16,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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..311be183 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -14,23 +15,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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..fd3bc2cf 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -14,23 +15,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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..7f65f316 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,3 +1,5 @@ +from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType +from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional @@ -12,43 +14,7 @@ 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 + geode_object_type: GeodeObjectType @dataclass @@ -57,12 +23,12 @@ def __post_init__(self) -> None: print_dataclass(self) geode_id: str - geode_object_type: str + geode_object_type: GeodeObjectType id: str 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/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_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/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/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/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..51b26e8f 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -14,23 +15,12 @@ def __post_init__(self) -> None: 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] - - @dataclass 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/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/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"} From f3d6138aaf3d4eb906d6fa5978b16ef3b4650019 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 15:15:20 +0100 Subject: [PATCH 3/7] fix(types): type the geode object types with GeodeObjectType Co-Authored-By: Claude Opus 5.5 --- src/opengeodeweb_back/geode_functions.py | 6 +++--- src/opengeodeweb_back/routes/blueprint_routes.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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/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 From 9fe422496f53808b3e38bcdcb43a7c953cbd6ba6 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 15:15:20 +0100 Subject: [PATCH 4/7] fix(crs): use the shared CRS type Co-Authored-By: Claude Opus 5.5 --- src/opengeodeweb_back/routes/basemap/blueprint_basemap.py | 3 ++- src/opengeodeweb_back/routes/crs/blueprint_crs.py | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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/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(), From 898ad6e99e6056ef4588375e24928b79248310f1 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 16:24:55 +0100 Subject: [PATCH 5/7] fix(schemas): name the alias types in the generated code Co-Authored-By: Claude Opus 5.5 --- opengeodeweb_back_typed_schemas.d.ts | 150 +++++++++--------- .../routes/basemap/schemas/build.py | 5 +- .../routes/basemap/schemas/delete.py | 5 +- .../routes/create/schemas/edged_curve.py | 6 +- .../routes/create/schemas/horizon_stack.py | 5 +- .../routes/create/schemas/point_set.py | 6 +- .../create/schemas/polygonal_surface.py | 6 +- .../routes/crs/schemas/active.py | 3 +- .../routes/crs/schemas/align.py | 7 +- .../routes/crs/schemas/assign_geographic.py | 7 +- .../routes/crs/schemas/convert_geographic.py | 7 +- .../routes/schemas/allowed_objects.py | 3 +- .../routes/schemas/apply_time_series.py | 5 +- .../routes/schemas/cell_attribute_names.py | 3 +- .../routes/schemas/cell_attribute_range.py | 5 +- .../routes/schemas/data_missing_files.py | 3 +- .../routes/schemas/edge_attribute_names.py | 3 +- .../routes/schemas/edge_attribute_range.py | 5 +- .../routes/schemas/export_project.py | 3 +- .../geode_objects_and_output_extensions.py | 3 +- .../routes/schemas/horizon_stack_info.py | 7 +- .../model_component_edge_attribute_names.py | 5 +- .../model_component_edge_attribute_range.py | 7 +- ...model_component_polygon_attribute_names.py | 5 +- ...model_component_polygon_attribute_range.py | 7 +- ...el_component_polyhedron_attribute_names.py | 5 +- ...el_component_polyhedron_attribute_range.py | 7 +- .../model_component_vertex_attribute_names.py | 5 +- .../model_component_vertex_attribute_range.py | 7 +- .../routes/schemas/polygon_attribute_names.py | 3 +- .../routes/schemas/polygon_attribute_range.py | 5 +- .../schemas/polyhedron_attribute_names.py | 3 +- .../schemas/polyhedron_attribute_range.py | 5 +- .../routes/schemas/save_viewable_file.py | 7 +- .../routes/schemas/texture_coordinates.py | 3 +- .../schemas/time_series_allowed_objects.py | 3 +- .../schemas/time_series_missing_files.py | 3 +- .../routes/schemas/upload_file.py | 3 +- .../routes/schemas/validate.py | 3 +- .../routes/schemas/vertex_attribute_names.py | 3 +- .../routes/schemas/vertex_attribute_range.py | 5 +- src/opengeodeweb_back/schema_types.d.ts | 16 +- src/opengeodeweb_back/schema_types.py | 17 +- 43 files changed, 208 insertions(+), 166 deletions(-) diff --git a/opengeodeweb_back_typed_schemas.d.ts b/opengeodeweb_back_typed_schemas.d.ts index d8eb9b20..80538e94 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -1,16 +1,16 @@ // Generated by opengeodeweb-microservice-generate, do not edit. import type json from "./opengeodeweb_back_schemas.json"; +import type { AttributeName, DataId, Filename, GeodeId, Point3D, ViewerId } from "@geode/opengeodeweb-microservice/schema_types"; import type { AttributeInfo, CRS, CollectionComponent, MeshComponent } from "@geode/opengeodeweb-back/schema_types"; -import type { Point3D } from "@geode/opengeodeweb-microservice/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 { @@ -37,9 +37,9 @@ export interface BasemapBuildResponse { bounds: MeshBounds; columns: number; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; maps: MapElement[]; name: string; @@ -73,9 +73,9 @@ export interface CreatePolygonalSurfaceResponse { binary_light_viewable?: string; collection_components?: CollectionComponent[]; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; mesh_components?: MeshComponent[]; name: string; @@ -94,9 +94,9 @@ export interface CreatePointSetResponse { binary_light_viewable?: string; collection_components?: CollectionComponent[]; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; mesh_components?: MeshComponent[]; name: string; @@ -116,9 +116,9 @@ export interface CreateHorizonStackResponse { binary_light_viewable?: string; collection_components?: CollectionComponent[]; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; mesh_components?: MeshComponent[]; name: string; @@ -138,9 +138,9 @@ export interface CreateEdgedCurveResponse { binary_light_viewable?: string; collection_components?: CollectionComponent[]; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; mesh_components?: MeshComponent[]; name: string; @@ -161,8 +161,8 @@ export interface CRSGeographicListResponse { export interface CRSConvertGeographicParams { authority: string; code: string; - id: string; - linked_ids?: string[]; + id: DataId; + linked_ids?: DataId[]; name: string; } @@ -175,14 +175,14 @@ export interface CRSConvertGeographicResponse { export interface CRSConvertGeographicResponseLinked { binary_light_viewable?: string; crs?: CRS; - id: string; + id: DataId; } export interface CRSAssignGeographicParams { authority: string; code: string; - id: string; - linked_ids?: string[]; + id: DataId; + linked_ids?: DataId[]; name: string; only_plausible?: boolean; } @@ -195,15 +195,15 @@ export interface CRSAssignGeographicResponse { export interface CRSAssignGeographicResponseLinked { crs?: CRS; - id: string; + id: DataId; implausible?: boolean; } 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[]; @@ -229,11 +229,11 @@ export interface CRSAlignResponse { export interface CRSAlignResponseLinked { binary_light_viewable?: string; crs?: CRS; - id: string; + id: DataId; } export interface CRSActiveParams { - id: string; + id: DataId; } export interface CRSActiveResponse { @@ -242,8 +242,8 @@ export interface CRSActiveResponse { } export interface VertexAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface VertexAttributeRangeResponse { @@ -253,7 +253,7 @@ export interface VertexAttributeRangeResponse { } export interface VertexAttributeNamesParams { - id: string; + id: DataId; } export interface VertexAttributeNamesResponse { @@ -261,7 +261,7 @@ export interface VertexAttributeNamesResponse { } export interface ValidateParams { - id: string; + id: DataId; } export interface ValidateResponse { @@ -271,7 +271,7 @@ export interface ValidateResponse { } export interface UploadFileParams { - filename?: string; + filename?: Filename; } export interface UploadFileResponse { @@ -279,7 +279,7 @@ export interface UploadFileResponse { } export interface TimeSeriesMissingFilesParams { - filename: string; + filename: Filename; } export interface TimeSeriesMissingFilesResponse { @@ -289,7 +289,7 @@ export interface TimeSeriesMissingFilesResponse { } export interface TimeSeriesAllowedObjectsParams { - filename: string; + filename: Filename; } export interface TimeSeriesAllowedObjectsResponse { @@ -297,7 +297,7 @@ export interface TimeSeriesAllowedObjectsResponse { } export interface TextureCoordinatesParams { - id: string; + id: DataId; } export interface TextureCoordinatesResponse { @@ -305,7 +305,7 @@ export interface TextureCoordinatesResponse { } export interface SaveViewableFileParams { - filename: string; + filename: Filename; geode_object_type: GeodeObjectType; } @@ -317,9 +317,9 @@ export interface SaveViewableFileItem { binary_light_viewable?: string; collection_components?: CollectionComponent[]; crs?: CRS; - geode_id: string; + geode_id: GeodeId; geode_object_type: GeodeObjectType; - id: string; + id: DataId; is_viewable: boolean; mesh_components?: MeshComponent[]; name: string; @@ -330,8 +330,8 @@ export interface SaveViewableFileItem { } export interface PolyhedronAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface PolyhedronAttributeRangeResponse { @@ -341,7 +341,7 @@ export interface PolyhedronAttributeRangeResponse { } export interface PolyhedronAttributeNamesParams { - id: string; + id: DataId; } export interface PolyhedronAttributeNamesResponse { @@ -349,8 +349,8 @@ export interface PolyhedronAttributeNamesResponse { } export interface PolygonAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface PolygonAttributeRangeResponse { @@ -360,7 +360,7 @@ export interface PolygonAttributeRangeResponse { } export interface PolygonAttributeNamesParams { - id: string; + id: DataId; } export interface PolygonAttributeNamesResponse { @@ -375,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 { @@ -387,8 +387,8 @@ export interface ModelComponentVertexAttributeRangeResponse { } export interface ModelComponentVertexAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentVertexAttributeNamesResponse { @@ -396,9 +396,9 @@ export interface ModelComponentVertexAttributeNamesResponse { } export interface ModelComponentPolyhedronAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolyhedronAttributeRangeResponse { @@ -408,8 +408,8 @@ export interface ModelComponentPolyhedronAttributeRangeResponse { } export interface ModelComponentPolyhedronAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolyhedronAttributeNamesResponse { @@ -417,9 +417,9 @@ export interface ModelComponentPolyhedronAttributeNamesResponse { } export interface ModelComponentPolygonAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolygonAttributeRangeResponse { @@ -429,8 +429,8 @@ export interface ModelComponentPolygonAttributeRangeResponse { } export interface ModelComponentPolygonAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentPolygonAttributeNamesResponse { @@ -438,9 +438,9 @@ export interface ModelComponentPolygonAttributeNamesResponse { } export interface ModelComponentEdgeAttributeRangeParams { - attribute_name: string; - component_ids: string[]; - id: string; + attribute_name: AttributeName; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentEdgeAttributeRangeResponse { @@ -450,8 +450,8 @@ export interface ModelComponentEdgeAttributeRangeResponse { } export interface ModelComponentEdgeAttributeNamesParams { - component_ids: string[]; - id: string; + component_ids: GeodeId[]; + id: DataId; } export interface ModelComponentEdgeAttributeNamesResponse { @@ -473,7 +473,7 @@ export interface ImportProjectResponse { } export interface HorizonStackInfoParams { - id: string; + id: DataId; } export interface HorizonStackInfoResponse { @@ -482,17 +482,17 @@ 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; + filename: Filename; geode_object_type: GeodeObjectType; } @@ -510,13 +510,13 @@ export interface GeodeObjectInheritanceResponse { } 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 { @@ -526,7 +526,7 @@ export interface EdgeAttributeRangeResponse { } export interface EdgeAttributeNamesParams { - id: string; + id: DataId; } export interface EdgeAttributeNamesResponse { @@ -534,7 +534,7 @@ export interface EdgeAttributeNamesResponse { } export interface DataMissingFilesParams { - filename: string; + filename: Filename; geode_object_type: GeodeObjectType; } @@ -545,8 +545,8 @@ export interface DataMissingFilesResponse { } export interface CellAttributeRangeParams { - attribute_name: string; - id: string; + attribute_name: AttributeName; + id: DataId; } export interface CellAttributeRangeResponse { @@ -556,7 +556,7 @@ export interface CellAttributeRangeResponse { } export interface CellAttributeNamesParams { - id: string; + id: DataId; } export interface CellAttributeNamesResponse { @@ -564,15 +564,15 @@ export interface CellAttributeNamesResponse { } export interface ApplyTimeSeriesParams { - filename: string; - id: string; + filename: Filename; + id: DataId; } export interface ApplyTimeSeriesResponse { } export interface AllowedObjectsParams { - filename: string; + filename: Filename; } export interface AllowedObjectsResponse { diff --git a/src/opengeodeweb_back/routes/basemap/schemas/build.py b/src/opengeodeweb_back/routes/basemap/schemas/build.py index 8170c38e..b798c0cd 100644 --- a/src/opengeodeweb_back/routes/basemap/schemas/build.py +++ b/src/opengeodeweb_back/routes/basemap/schemas/build.py @@ -1,3 +1,4 @@ +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 @@ -67,9 +68,9 @@ def __post_init__(self) -> None: attribution: str bounds: MeshBounds columns: int - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool maps: List[MapElement] name: str 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/create/schemas/edged_curve.py b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py index 0eff3089..98aa0808 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py @@ -1,5 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType -from opengeodeweb_microservice.schema_types import Point3D from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -25,9 +25,9 @@ class EdgedCurveResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool name: str native_file: str diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py index 577deb38..30a5e3ba 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId, ViewerId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path @@ -24,9 +25,9 @@ class HorizonStackResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool name: str native_file: str diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.py b/src/opengeodeweb_back/routes/create/schemas/point_set.py index db716f27..33982942 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.py +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.py @@ -1,5 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType -from opengeodeweb_microservice.schema_types import Point3D from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -24,9 +24,9 @@ class PointSetResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool name: str native_file: str diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py index eb7f0bfb..49b91394 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py @@ -1,5 +1,5 @@ +from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType -from opengeodeweb_microservice.schema_types import Point3D from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -25,9 +25,9 @@ class PolygonalSurfaceResponse(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool name: str native_file: str diff --git a/src/opengeodeweb_back/routes/crs/schemas/active.py b/src/opengeodeweb_back/routes/crs/schemas/active.py index 087d7266..75269a65 100644 --- a/src/opengeodeweb_back/routes/crs/schemas/active.py +++ b/src/opengeodeweb_back/routes/crs/schemas/active.py @@ -1,3 +1,4 @@ +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 @@ -12,7 +13,7 @@ class Active(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass 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.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.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/schemas/allowed_objects.py b/src/opengeodeweb_back/routes/schemas/allowed_objects.py index 445fc3dd..f2310d4e 100644 --- a/src/opengeodeweb_back/routes/schemas/allowed_objects.py +++ b/src/opengeodeweb_back/routes/schemas/allowed_objects.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import Filename from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class AllowedObjects(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/apply_time_series.py b/src/opengeodeweb_back/routes/schemas/apply_time_series.py index d5b6222f..19745e7c 100644 --- a/src/opengeodeweb_back/routes/schemas/apply_time_series.py +++ b/src/opengeodeweb_back/routes/schemas/apply_time_series.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId, Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -10,8 +11,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.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py index ad065537..45e6ee76 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class CellAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py index 451483c5..5818ca97 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +12,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.py b/src/opengeodeweb_back/routes/schemas/data_missing_files.py index c8b1df72..5e47dcbc 100644 --- a/src/opengeodeweb_back/routes/schemas/data_missing_files.py +++ b/src/opengeodeweb_back/routes/schemas/data_missing_files.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import Filename from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class DataMissingFiles(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename geode_object_type: GeodeObjectType diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py index c3a69be9..df49e26c 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class EdgeAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py index ddda1cfd..c23a1eaa 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +12,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.py b/src/opengeodeweb_back/routes/schemas/export_project.py index 78edc3d6..70d4a5cd 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_microservice.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_objects_and_output_extensions.py b/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.py index abf0033e..c71f4ecb 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,4 @@ +from opengeodeweb_microservice.schema_types import Filename from opengeodeweb_microservice.database.data_types import GeodeObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class GeodeObjectsAndOutputExtensions(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename geode_object_type: GeodeObjectType 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.py b/src/opengeodeweb_back/routes/schemas/model_component_edge_attribute_names.py index 906b68a2..962ee972 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,8 +13,8 @@ class ModelComponentEdgeAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str + component_ids: List[GeodeId] + id: DataId @dataclass 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..64d0b7f2 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +12,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.py b/src/opengeodeweb_back/routes/schemas/model_component_polygon_attribute_names.py index eb378d54..369f3541 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,8 +13,8 @@ class ModelComponentPolygonAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str + component_ids: List[GeodeId] + id: DataId @dataclass 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..368afc06 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +12,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.py b/src/opengeodeweb_back/routes/schemas/model_component_polyhedron_attribute_names.py index 178c81f9..eecd3d6b 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,8 +13,8 @@ class ModelComponentPolyhedronAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str + component_ids: List[GeodeId] + id: DataId @dataclass 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..1bb7602e 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +12,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.py b/src/opengeodeweb_back/routes/schemas/model_component_vertex_attribute_names.py index 108d76a9..b77b904a 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,8 +13,8 @@ class ModelComponentVertexAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - component_ids: List[str] - id: str + component_ids: List[GeodeId] + id: DataId @dataclass 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..01e6767b 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,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin @@ -11,9 +12,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.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py index 311be183..2f3cf595 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class PolygonAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py index fc5335f0..f8d353aa 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +12,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.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py index fd3bc2cf..29b16323 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class PolyhedronAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py index a9a4e9f3..70feac8b 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +12,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.py b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py index 7f65f316..a5f92216 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import DataId, Filename, GeodeId, ViewerId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path @@ -13,7 +14,7 @@ class SaveViewableFile(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - filename: str + filename: Filename geode_object_type: GeodeObjectType @@ -22,9 +23,9 @@ class SaveViewableFileItem(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId geode_object_type: GeodeObjectType - id: str + id: DataId is_viewable: bool name: str native_file: str 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.py b/src/opengeodeweb_back/routes/schemas/time_series_allowed_objects.py index dc07b88e..74e01608 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_microservice.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.py b/src/opengeodeweb_back/routes/schemas/time_series_missing_files.py index 4f36641f..8270f2df 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_microservice.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.py b/src/opengeodeweb_back/routes/schemas/upload_file.py index 200a177e..afac52d7 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_microservice.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.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.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py index 51b26e8f..7f0f5b79 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from opengeodeweb_back.schema_types import AttributeInfo from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema @@ -12,7 +13,7 @@ class VertexAttributeNames(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - id: str + id: DataId @dataclass diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py index d8d0e1cf..b1f41843 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py @@ -1,3 +1,4 @@ +from opengeodeweb_microservice.schema_types import AttributeName, DataId from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List @@ -11,8 +12,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_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts index 4cf95636..0a24d5a6 100644 --- a/src/opengeodeweb_back/schema_types.d.ts +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -1,8 +1,10 @@ // Generated by generate_schema_types.js from schema_types.json: do not edit +import type { AttributeName, GeodeId, ViewerId } from "@geode/opengeodeweb-microservice/schema_types"; + export interface AttributeInfo { attribute_id: string; - attribute_name: string; + attribute_name: AttributeName; nb_items: number; time_steps: number[]; } @@ -14,19 +16,19 @@ export interface CRS { } export interface MeshComponent { - boundaries: string[]; - geode_id: string; - internals: string[]; + boundaries: GeodeId[]; + geode_id: GeodeId; + internals: GeodeId[]; is_active: boolean; name: string; type: string; - viewer_id: number; + viewer_id: ViewerId; } export interface CollectionComponent { - geode_id: string; + geode_id: GeodeId; is_active: boolean; - items: string[]; + items: GeodeId[]; name: string; type: string; } diff --git a/src/opengeodeweb_back/schema_types.py b/src/opengeodeweb_back/schema_types.py index 3449743f..f06fa1b3 100644 --- a/src/opengeodeweb_back/schema_types.py +++ b/src/opengeodeweb_back/schema_types.py @@ -1,8 +1,11 @@ """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 AttributeName, GeodeId, ViewerId from opengeodeweb_microservice.schemas import print_dataclass @@ -12,7 +15,7 @@ def __post_init__(self) -> None: print_dataclass(self) attribute_id: str - attribute_name: str + attribute_name: AttributeName nb_items: int time_steps: list[float] @@ -32,13 +35,13 @@ class MeshComponent(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - boundaries: list[str] - geode_id: str - internals: list[str] + boundaries: list[GeodeId] + geode_id: GeodeId + internals: list[GeodeId] is_active: bool name: str type: str - viewer_id: int + viewer_id: ViewerId @dataclass @@ -46,9 +49,9 @@ class CollectionComponent(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) - geode_id: str + geode_id: GeodeId is_active: bool - items: list[str] + items: list[GeodeId] name: str type: str From ca08f8cf6986804f3f67b7304dd633b954d9d020 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Thu, 19 Nov 2026 17:05:54 +0100 Subject: [PATCH 6/7] fix(schemas): define ViewerId, AttributeName, Filename and Point3D OpenGeodeWeb-Microservice only defines DataId and GeodeId. Co-Authored-By: Claude Opus 5.5 --- opengeodeweb_back_typed_schemas.d.ts | 4 +- .../routes/create/schemas/edged_curve.py | 4 +- .../routes/create/schemas/horizon_stack.py | 4 +- .../routes/create/schemas/point_set.py | 4 +- .../create/schemas/polygonal_surface.py | 4 +- .../routes/schemas/allowed_objects.py | 2 +- .../routes/schemas/apply_time_series.py | 3 +- .../routes/schemas/cell_attribute_names.py | 4 +- .../routes/schemas/cell_attribute_range.py | 3 +- .../routes/schemas/data_missing_files.py | 2 +- .../routes/schemas/edge_attribute_names.py | 4 +- .../routes/schemas/edge_attribute_range.py | 3 +- .../routes/schemas/export_project.py | 2 +- .../geode_objects_and_output_extensions.py | 2 +- .../model_component_edge_attribute_names.py | 4 +- .../model_component_edge_attribute_range.py | 3 +- ...model_component_polygon_attribute_names.py | 4 +- ...model_component_polygon_attribute_range.py | 3 +- ...el_component_polyhedron_attribute_names.py | 4 +- ...el_component_polyhedron_attribute_range.py | 3 +- .../model_component_vertex_attribute_names.py | 4 +- .../model_component_vertex_attribute_range.py | 3 +- .../routes/schemas/polygon_attribute_names.py | 4 +- .../routes/schemas/polygon_attribute_range.py | 3 +- .../schemas/polyhedron_attribute_names.py | 4 +- .../schemas/polyhedron_attribute_range.py | 3 +- .../routes/schemas/save_viewable_file.py | 4 +- .../schemas/time_series_allowed_objects.py | 2 +- .../schemas/time_series_missing_files.py | 2 +- .../routes/schemas/upload_file.py | 2 +- .../routes/schemas/vertex_attribute_names.py | 4 +- .../routes/schemas/vertex_attribute_range.py | 3 +- src/opengeodeweb_back/schema_types.d.ts | 12 +++- src/opengeodeweb_back/schema_types.json | 62 +++++++++++++++++-- src/opengeodeweb_back/schema_types.py | 20 +++++- 35 files changed, 145 insertions(+), 53 deletions(-) diff --git a/opengeodeweb_back_typed_schemas.d.ts b/opengeodeweb_back_typed_schemas.d.ts index 80538e94..a3d1d297 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -1,8 +1,8 @@ // Generated by opengeodeweb-microservice-generate, do not edit. import type json from "./opengeodeweb_back_schemas.json"; -import type { AttributeName, DataId, Filename, GeodeId, Point3D, ViewerId } from "@geode/opengeodeweb-microservice/schema_types"; -import type { AttributeInfo, CRS, CollectionComponent, MeshComponent } from "@geode/opengeodeweb-back/schema_types"; +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 { diff --git a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py index 98aa0808..fb16e388 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py @@ -1,6 +1,6 @@ -from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId +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 opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py index 30a5e3ba..d446c63c 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,6 +1,6 @@ -from opengeodeweb_microservice.schema_types import DataId, GeodeId, ViewerId +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 opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.py b/src/opengeodeweb_back/routes/create/schemas/point_set.py index 33982942..e0af2779 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.py +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.py @@ -1,6 +1,6 @@ -from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId +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 opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py index 49b91394..bcb9c117 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py @@ -1,6 +1,6 @@ -from opengeodeweb_microservice.schema_types import DataId, GeodeId, Point3D, ViewerId +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 opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional diff --git a/src/opengeodeweb_back/routes/schemas/allowed_objects.py b/src/opengeodeweb_back/routes/schemas/allowed_objects.py index f2310d4e..cde049f0 100644 --- a/src/opengeodeweb_back/routes/schemas/allowed_objects.py +++ b/src/opengeodeweb_back/routes/schemas/allowed_objects.py @@ -1,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +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 diff --git a/src/opengeodeweb_back/routes/schemas/apply_time_series.py b/src/opengeodeweb_back/routes/schemas/apply_time_series.py index 19745e7c..5657177b 100644 --- a/src/opengeodeweb_back/routes/schemas/apply_time_series.py +++ b/src/opengeodeweb_back/routes/schemas/apply_time_series.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import DataId, Filename +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 diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py index 45e6ee76..eb8de15e 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_names.py @@ -1,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId -from opengeodeweb_back.schema_types import AttributeInfo +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 diff --git a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py index 5818ca97..bbcc0e6a 100644 --- a/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/cell_attribute_range.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId +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 diff --git a/src/opengeodeweb_back/routes/schemas/data_missing_files.py b/src/opengeodeweb_back/routes/schemas/data_missing_files.py index 5e47dcbc..e8f81973 100644 --- a/src/opengeodeweb_back/routes/schemas/data_missing_files.py +++ b/src/opengeodeweb_back/routes/schemas/data_missing_files.py @@ -1,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +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 diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py index df49e26c..05be560c 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_names.py @@ -1,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId -from opengeodeweb_back.schema_types import AttributeInfo +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 diff --git a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py index c23a1eaa..84bab5f0 100644 --- a/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/edge_attribute_range.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId +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 diff --git a/src/opengeodeweb_back/routes/schemas/export_project.py b/src/opengeodeweb_back/routes/schemas/export_project.py index 70d4a5cd..adc4fbf7 100644 --- a/src/opengeodeweb_back/routes/schemas/export_project.py +++ b/src/opengeodeweb_back/routes/schemas/export_project.py @@ -1,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +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 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 c71f4ecb..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,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +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 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 962ee972..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,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId -from opengeodeweb_back.schema_types import AttributeInfo +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 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 64d0b7f2..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,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId +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 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 369f3541..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,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId -from opengeodeweb_back.schema_types import AttributeInfo +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 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 368afc06..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,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId +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 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 eecd3d6b..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,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId -from opengeodeweb_back.schema_types import AttributeInfo +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 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 1bb7602e..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,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId +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 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 b77b904a..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,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId -from opengeodeweb_back.schema_types import AttributeInfo +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 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 01e6767b..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,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId, GeodeId +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 diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py index 2f3cf595..31c818db 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_names.py @@ -1,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId -from opengeodeweb_back.schema_types import AttributeInfo +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 diff --git a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py index f8d353aa..0c76afe2 100644 --- a/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polygon_attribute_range.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId +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 diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py index 29b16323..f8b7f8fe 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_names.py @@ -1,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId -from opengeodeweb_back.schema_types import AttributeInfo +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 diff --git a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py index 70feac8b..bd91f0aa 100644 --- a/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/polyhedron_attribute_range.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId +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 diff --git a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py index a5f92216..2db115e7 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,6 +1,6 @@ -from opengeodeweb_microservice.schema_types import DataId, Filename, GeodeId, ViewerId +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 opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List, Optional 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 74e01608..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,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List 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 8270f2df..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,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from typing import List diff --git a/src/opengeodeweb_back/routes/schemas/upload_file.py b/src/opengeodeweb_back/routes/schemas/upload_file.py index afac52d7..1b30bd37 100644 --- a/src/opengeodeweb_back/routes/schemas/upload_file.py +++ b/src/opengeodeweb_back/routes/schemas/upload_file.py @@ -1,4 +1,4 @@ -from opengeodeweb_microservice.schema_types import Filename +from opengeodeweb_back.schema_types import Filename from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema from dataclasses_json import DataClassJsonMixin diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py index 7f0f5b79..01a588f8 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_names.py @@ -1,5 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId -from opengeodeweb_back.schema_types import AttributeInfo +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 diff --git a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py index b1f41843..ad4ab0de 100644 --- a/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py +++ b/src/opengeodeweb_back/routes/schemas/vertex_attribute_range.py @@ -1,4 +1,5 @@ -from opengeodeweb_microservice.schema_types import AttributeName, DataId +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 diff --git a/src/opengeodeweb_back/schema_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts index 0a24d5a6..7cc8de14 100644 --- a/src/opengeodeweb_back/schema_types.d.ts +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -1,6 +1,16 @@ // Generated by generate_schema_types.js from schema_types.json: do not edit -import type { AttributeName, GeodeId, ViewerId } from "@geode/opengeodeweb-microservice/schema_types"; +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; diff --git a/src/opengeodeweb_back/schema_types.json b/src/opengeodeweb_back/schema_types.json index eb2cf02b..a9c7bc50 100644 --- a/src/opengeodeweb_back/schema_types.json +++ b/src/opengeodeweb_back/schema_types.json @@ -1,4 +1,35 @@ { + "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": { @@ -18,7 +49,12 @@ } } }, - "required": ["attribute_name", "attribute_id", "nb_items", "time_steps"], + "required": [ + "attribute_name", + "attribute_id", + "nb_items", + "time_steps" + ], "additionalProperties": false }, "CRS": { @@ -37,7 +73,11 @@ "minLength": 1 } }, - "required": ["authority", "code", "name"], + "required": [ + "authority", + "code", + "name" + ], "additionalProperties": false }, "MeshComponent": { @@ -71,7 +111,15 @@ "type": "boolean" } }, - "required": ["viewer_id", "geode_id", "name", "type", "boundaries", "internals", "is_active"], + "required": [ + "viewer_id", + "geode_id", + "name", + "type", + "boundaries", + "internals", + "is_active" + ], "additionalProperties": false }, "CollectionComponent": { @@ -96,7 +144,13 @@ "type": "boolean" } }, - "required": ["geode_id", "name", "type", "items", "is_active"], + "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 index f06fa1b3..8a4cce59 100644 --- a/src/opengeodeweb_back/schema_types.py +++ b/src/opengeodeweb_back/schema_types.py @@ -5,9 +5,23 @@ from dataclasses import dataclass from dataclasses_json import DataClassJsonMixin -from opengeodeweb_microservice.schema_types import AttributeName, GeodeId, ViewerId +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): @@ -59,6 +73,10 @@ def __post_init__(self) -> None: __all__ = [ "CRS", "AttributeInfo", + "AttributeName", "CollectionComponent", + "Filename", "MeshComponent", + "Point3D", + "ViewerId", ] From 63a33f9ecb6ce78d8a3119d26024154f679d6014 Mon Sep 17 00:00:00 2001 From: JulienChampagnol <91873154+JulienChampagnol@users.noreply.github.com> Date: Fri, 20 Nov 2026 09:32:54 +0000 Subject: [PATCH 7/7] Apply prepare changes --- requirements.txt | 1 - 1 file changed, 1 deletion(-) 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