Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand causes serialization to ignore JsonConverterAttribute #2730

Open
arontsang opened this issue Nov 29, 2022 · 1 comment
Open

Expand causes serialization to ignore JsonConverterAttribute #2730

arontsang opened this issue Nov 29, 2022 · 1 comment
Assignees

Comments

@arontsang
Copy link

Microsoft.AspNet.OData.Query.Expressions.SelectExpandWrapperConverter only respects JsonPropertyAttribute

It does not respect JsonConverterAttribute and possibly DataMemberAttribute, JsonIgnore etc...

In fact, I suspect it makes more sense to unwrap the SelectExpandWrapper<TElement> iff TElement is a user defined type (rather than dynamically generated type), and write that instead.

@arontsang arontsang changed the title Expand changes the behavior of serialization Expand causes serialization to ignore JsonConverterAttribute Nov 29, 2022
@xuzhg
Copy link
Member

xuzhg commented Dec 6, 2022

At 8.x, we have the extension to let customers to customize the property mapper.
see here: https://github.com/OData/AspNetCoreOData/blob/main/src/Microsoft.AspNetCore.OData.NewtonsoftJson/ODataNewtonsoftJsonMvcBuilderExtensions.cs#L38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants