schmittjoh / JMSSerializerBundle

Easily serialize, and deserialize data of any complexity (supports XML, JSON, YAML)
http://jmsyst.com/bundles/JMSSerializerBundle
MIT License
1.8k stars 311 forks source link

Add support for injecting the expression evaluator into metadata drivers #914

Closed mbabker closed 1 year ago

mbabker commented 1 year ago
Q A
Bug fix? no
New feature? yes
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT

Right now, without adding a compiler pass in a downstream application, the metadata drivers can't receive an expression evaluator. This adds support for injecting the configured evaluator as long as the service implements JMS\Serializer\Expression\CompilableExpressionEvaluatorInterface.

mbabker commented 1 year ago

Well, I have no idea how to deal with DIUtils::getRealId() here. I don't know if the jms_serializer.expression_evaluator service is supposed to be different for each serializer instance, but if it is, I have no idea how to work around that.

goetas commented 1 year ago

thanks for this PR. I totally forgot about the compiled expression evaluator

goetas commented 1 year ago

thank you!