Skip to content

v1.22.0

Choose a tag to compare

@yuriizee yuriizee released this 05 Aug 07:19
· 17 commits to main since this release

[1.22.0] — 2026-08-05

Added

  • #[Computed] — adds a derived, method-backed field to serialization
    output. Works on constructor-based, constructor-less, and hybrid classes.
    • Public, non-static, zero-required-parameter methods only; a method
      requiring parameters throws at metadata-build time.
    • Default output key is the method name (subject to the class-level
      #[TransformKeys] strategy, same as properties); override with
      #[Computed('custom_key')].
    • The return value is normalized the same way any other field is —
      nested BaseData, enums, and Collections serialize correctly.
    • Ignored on input, so from($dto->toArray()) keeps working;
      #[RejectUnknownKeys] treats the computed key as known.
  • Documentation: see #[Computed].

Full Changelog: v1.21.0...v1.22.0