Version
5.10.3
Description
Defining nested alternative names in a random order will ignore alternative names of nested Models, and use auto-generated ones instead.
This happens because setting the alternative name immediately also registers the corresponding Model, in turn registering all nested Models, without before setting the subsequent model's alternative name.
Because of this, the following alternative name config:
models:
names:
- { alias: GrandChildSpecial, type: App\Entity\GrandChild, groups: ['special'] }
- { alias: ChildSpecial, type: App\Entity\Child, groups: ['special'] }
- { alias: ParentSpecial, type: App\Entity\Parent, groups: ['special'] }
will work as it did before 5.5.
But a re-ordered name definiton like this:
models:
names:
- { alias: ChildSpecial, type: App\Entity\Child, groups: ['special'] }
- { alias: GrandChildSpecial, type: App\Entity\GrandChild, groups: ['special'] }
- { alias: ParentSpecial, type: App\Entity\Parent, groups: ['special'] }
will have the GrandChildSpecial use the auto-generated GrandChildn(n) instead, since at this point the alternative name of the child Model was not known yet.
This was introduced in 5.6, with the alternative name refactor: https://github.com/nelmio/NelmioApiDocBundle/pull/2542/changes#diff-d4f02c49939937ce274a40f41f3e257e7fe594fb3c158060cce490c0e0b30a96R86
JSON OpenApi
No response
Additional context
No response
Version
5.10.3
Description
Defining nested alternative names in a random order will ignore alternative names of nested Models, and use auto-generated ones instead.
This happens because setting the alternative name immediately also registers the corresponding Model, in turn registering all nested Models, without before setting the subsequent model's alternative name.
Because of this, the following alternative name config:
will work as it did before 5.5.
But a re-ordered name definiton like this:
will have the
GrandChildSpecialuse the auto-generatedGrandChildn(n)instead, since at this point the alternative name of the child Model was not known yet.This was introduced in 5.6, with the alternative name refactor: https://github.com/nelmio/NelmioApiDocBundle/pull/2542/changes#diff-d4f02c49939937ce274a40f41f3e257e7fe594fb3c158060cce490c0e0b30a96R86
JSON OpenApi
No response
Additional context
No response