Skip to content

Bug: Litestar DTO hybrid_property gets called on class instead of instance #662

@provinzkraut

Description

@provinzkraut

Description

This is a bug introduced in #447.
Before, a hybrid_property declared on a model would work hybrid in a DTO, that is, it would use the instance call chain. Now, the hybrid method gets invoked with on the class itself during DTO serialisation, which can break some use cases.

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

Package Version

1.8.0

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions