Skip to content

feat: add support for Symfony #[SerializedPath] attribute#2707

Open
paaneko wants to merge 1 commit intonelmio:5.xfrom
paaneko:feat/serializer-path-attribute
Open

feat: add support for Symfony #[SerializedPath] attribute#2707
paaneko wants to merge 1 commit intonelmio:5.xfrom
paaneko:feat/serializer-path-attribute

Conversation

@paaneko
Copy link
Copy Markdown

@paaneko paaneko commented Mar 6, 2026

Properties annotated with #[SerializedPath] are now mapped to nested object structures in the generated OpenAPI schema, matching Symfony's serializer behavior.

https://symfony.com/doc/current/serializer.html#deserializing-nested-structures

Description

When a property is annotated with #[SerializedPath('[data][name]')], the generated OpenAPI schema now correctly places it inside a nested data object with a name leaf, instead of exposing it as a flat root-level property.

This covers: nested paths, single-level paths (renames), method-level paths on setters/getters, constructor-properties, interaction with #[Groups], #[Ignore], #[SerializedName], and #[OA\Property] overrides.

What type of PR is this? (check all applicable)

  • Bug Fix
  • Feature
  • Refactor
  • Deprecation
  • Breaking Change
  • Documentation Update
  • CI

Checklist

  • I have made corresponding changes to the documentation (docs/)

NOTE: This new feature works transparently like #[SerializedName] and #[Groups], which are not documented separately.

Properties annotated with #[SerializedPath] are now mapped to nested
object structures in the generated OpenAPI schema, matching Symfony's
serializer behavior.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.62%. Comparing base (7f69a49) to head (41ef0f7).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              5.x    #2707      +/-   ##
==========================================
+ Coverage   95.59%   95.62%   +0.02%     
==========================================
  Files          94       94              
  Lines        3064     3083      +19     
==========================================
+ Hits         2929     2948      +19     
  Misses        135      135              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant