fix graph edges in geometry endpoint (hopefully)
the graph edge and geometry schemas are similar and pydantic matches graph edges as geometries if graph edges aren't first in the union types, which makes the from and to nodes disappear
This commit is contained in:
parent
d6f234cf1f
commit
b776a7be29
1 changed files with 5 additions and 1 deletions
|
@ -67,6 +67,10 @@ class EditorGeometriesGraphEdgePropertiesSchema(BaseSchema):
|
|||
type: Literal["graphedge"]
|
||||
from_node: EditorID
|
||||
to_node: EditorID
|
||||
color: Union[
|
||||
Annotated[str, APIField(title="color")],
|
||||
Annotated[None, APIField(title="no color")]
|
||||
] = None
|
||||
|
||||
|
||||
class EditorGeometriesGraphEdgeElemSchema(BaseSchema):
|
||||
|
@ -87,8 +91,8 @@ class EditorGeometriesGeometryElemSchema(BaseSchema):
|
|||
|
||||
EditorGeometriesElemSchema = Union[
|
||||
EditorGeometriesUpdateCacheKeyElem,
|
||||
Annotated[EditorGeometriesGeometryElemSchema, APIField(title="a geometry object")],
|
||||
Annotated[EditorGeometriesGraphEdgeElemSchema, APIField(title="a graph edge")],
|
||||
Annotated[EditorGeometriesGeometryElemSchema, APIField(title="a geometry object")],
|
||||
EditorGeometriesCacheReferenceElem,
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue