You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the PydanticDTO wrapper and I'm not seeing computed fields in either the generated openapi schema or the results. I've added the PydanticPlug to the application. Possibly unrelated, I'm also still seeing nodes marked as "exclude" in the pydantic showing up in the schema/results. Also, serialization alias generation from pydantic doesn't appear to affect the openapi schema.
Description
I'm using the
PydanticDTO
wrapper and I'm not seeing computed fields in either the generated openapi schema or the results. I've added thePydanticPlug
to the application. Possibly unrelated, I'm also still seeing nodes marked as "exclude" in the pydantic showing up in the schema/results. Also, serialization alias generation from pydantic doesn't appear to affect the openapi schema.The PR #2797 was intended to add computed fields. It introduces some code at https://github.com/litestar-org/litestar/blame/18d84d846b782ccaab06f550a4defce22b3082e8/litestar/contrib/pydantic/pydantic_schema_plugin.py#L312 that added the computed field definitions. Tracing through the execution, I believe I'm seeing the lack of similar code in the
PydanticDTO. generate_field_definitions
method to include these field definitions at in the pydantic dto factory. I would expect to see it at https://github.com/litestar-org/litestar/blame/18d84d846b782ccaab06f550a4defce22b3082e8/litestar/contrib/pydantic/pydantic_dto_factory.py#L109 ).The result seems to be that we generated backend that doesn't spit out the computed fields. I'll work on creating an example, but I suspect the issue might be obvious to someone familiar with the code.
URL to code causing the issue
No response
MCVE
Steps to reproduce
Logs
Litestar Version
2.10.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: