Open aaazzam opened 4 weeks ago
On reflection this isn't a hard problem, e.g.:
class Flow(ORMBaseModel):
"""An ORM representation of flow data."""
model_config = ConfigDict(json_schema_extra={"required": ["id", "name"]})
name: Name = Field(
default=..., description="The name of the flow", examples=["my-flow"]
)
tags: List[str] = Field(
default_factory=list,
description="A list of flow tags",
examples=[["tag-1", "tag-2"]],
)
fixes it.
Bug summary
I expect a request to
/flows/paginate
to return a (potentially empty) array of Flows.Flow
inherits fromIDBaseModel
which uses adefault_factory
to assign UUIDs on write, soid
is not a required field. Indeed, the OpenAPI spec correctly reports thatid
is optional, even thoughid
should be "required" on read. This makes client autogeneration in other languages tedious, since yourreads
could potentially return Flow objects with noids
, which makes no sense.Background:
The signature of this route is:
Here
FlowPaginationResponse
is a model with a field,results
, that is an array ofprefect.server.schemas.core.Flow
that inherits fromIDBaseModel
andORMBaseModel
.Since
Version info (
prefect version
output)Additional context
No response