Hey everyone,
I have a graph-like object, and a pydantic validator that checks that the source & target of the edges are node ids that are also a part of the payload. This essentially validates that every edge is connected to a node that exists. I've attached the pydantic definitions and the validators.
Now if I try to generate an OpenAPI schema where I have any API that takes GraphDto as a payload, it fails with the following error:
{
status_code: 400,
detail: null,
value_error: "1 validation error for GraphDto
edges
Invalid edges: wMvXnxifKuSqOCVwKKmq,wMvXnxifKuSqOCVwKKmq don't have a targets or the target nodes don't exist (type=value_error)"
}
It tries to generate random values based on the default function provided where it generates a shortuuid if the value is not a part of the payload. Is there a way to avoid this, and force a particular payload so the OpenAPI schema can be generated properly, or perhaps disable the validators just for the OpenAPI schema generation? I tried playing around with OpenAPIConfig config parameters such as random_seed or generate_examples to no avail.
Frankly, I'm not confident that I'm approaching this correct and would love to have some guidance. Thank you!