OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

No virtual method for creating Delta ComplexNestedResourceInfo #2858

Closed victorliu-microsoft closed 1 week ago

victorliu-microsoft commented 3 weeks ago

I am writing a custom Odata serializer that inherits from ODataResourceSerializer, overriding the CreateResource method. My goal is to conditionally filter out some properties to hide them from certain apps calling our service. We have success in filtering out some structural properties from our resource. I am also able to filter out complex nested resources through overriding CreateComplexNestedResourceInfo.

However, I am now trying to filter out a complex property for delta and noticed that the code doesn't run through CreateComplexNestedResourceInfo. It creates the complex resource through private methods in WriteDeltaResource

We need a way to override creating the delta complex resource, where if the overridden method returns null, that complex property won't show up in the serialized odata output. Something like a virtual "CreateDeltaComplexNestedResourceInfo".

Assemblies affected

OData WebApi lib 7.7.6.0

victorliu-microsoft commented 2 weeks ago

@xuzhg this PR will merge with master, so does that mean this change will come in the latest OData changes? Which version do you think it will be available in?

xuzhg commented 2 weeks ago

Once I receive the approval, I will merge it and update the release version. So far, it could be 7.7.7.

victorliu-microsoft commented 1 week ago

@xuzhg Thanks for getting this in, do you know when it will be released and ready for me to use? Thank you!!