Closed bendavies closed 10 years ago
We would need to let JMSSerializerResponseParser
and JMSSerializerBodyVisitor
know a map of class names to (De)SerializationContext
s and have it use the relevant one if it's there. These should be set up (by the user) as tagged services, then a compiler pass could inject them.
@thewilkybarkid can you let me know what you mean by
These should be set up (by the user) as tagged services, then a compiler pass could inject them.
I fully understand the concept of tagged services and compiler passes and how they work, but i don't see how you want to use these to configure JMSSerializerResponseParser
and JMSSerializerBodyVisitor
using them.
could you provide some pseudo code or example?
Thanks
Note that the user may want to provide a different serialisation group per operation
Looking at the Guzzle service description format again, operations have a data
property which could be used (so we could create contexts based on the value of keys like jms_serializer.groups
, jms_serializer.version
and jms_serializer.max_depth_checks
). That's a lot nicer/cleaner/more flexible.
Very good spot! I had a look through myself for any field that we could use for free form data, but didn't see anything.
http://docs.guzzlephp.org/en/latest/webservice-client/guzzle-service-descriptions.html#operations
data object Any arbitrary data to associate with the operation
I'll get to work on this.
I think it would be nice to have this ability.
Can you think of a nice way to be able to configure them? I'm happy to work on if it would be a useful feature