#Having issues with OpenAPI and Pydantic Responses

1 messages · Page 1 of 1 (latest)

graceful flare
#

We recently moved some of our response models to be strictly Pydantic types, but in doing so, we noticed those new controller's aren't registering in the OpenAPI schema. We have the pydantic plugin configured and the types registered in the signature_namespace, but for a large number of our routes, we're not even getting any errors of why the schema is coming back incomplete.

I'm happy to try to rip out a minimal reproduction, but before I do so, I'm just curious if there's any gothcas with how the OpenAPI plugin is looking for the types/registration.

Currently on version 2.5.1 in case bumping the version is the answer as well.

sudden falconBOT
#
Notes for Having issues with OpenAPI and Pydantic Responses
At your assistance

@graceful flare

No Response?

If no response in a reasonable time, ping @Member.

Closing

To close, type !solve or byte solve.

MCVE

Please include an MCVE so that we can reproduce your issue locally.

graceful flare
#

btw hi @fast halo

#

A quick look actually confirms it looks like the issue is isolated to Pydantic models that nest other Pydantic models

#

So are there any gotchas in the forward ref we're missing here?

graceful flare
#

To close the loop on this, this was our issue with circular imports, but, that error was getting quietly swallowed in the OpenAPI spec generation process