ConfigBuilderGenerator creating incorrect docs for the metadata methods on the Workflow component configs? #61136
Unanswered
KevinVanSonsbeek
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It is the latter: metadata haven’t been configured to have an attribute as key so the generator treats them as a list (see #40878 (comment)). Checking |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use the php config structure to configure workflows in my application.
The docs of the workflow component lack any information to even indicate that metadata is supported on workflows, places and transitions. But the config will actually build the methods on said configs.
Using the following config
I get the an error from PHPStan among the lines of:
Looking at the generated PlaceConfig in the cache i noticed the following param on the metadata method:
This seems to be a bit of a weird behavior, allowing to store metadata, but not actually getting the option to set keys for the metadata you are trying to add. Especially as the GetMetadataTrait Seems to expect the key of the set metadata to be a string.
The Configuration from the workflow component defines the metadata as an arrayNode, but even purposefully does not normalize the keys. (Giving the indication they want the defined keys to stay as they are in the configs)
Allowing you to create metadata configs with key: value using the yaml configs. As defining a yaml config with key value does not result in any errors.
Is this behavior on purpose?
Or is this a case where the ConfigBuilderGenerator just (incorrectly) assumes the node should be a list?
Beta Was this translation helpful? Give feedback.
All reactions