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

Does not work for reading value for untyped property with odata.type annotated #2693

Closed
xuzhg opened this issue Jun 20, 2023 · 0 comments · Fixed by #2694
Closed

Does not work for reading value for untyped property with odata.type annotated #2693

xuzhg opened this issue Jun 20, 2023 · 0 comments · Fixed by #2694

Comments

@xuzhg
Copy link
Member

xuzhg commented Jun 20, 2023

If we post a request using

{
"name": "sam",
"gender": "Male",
"data@odata.type":"#UntypedApp.Models.Gender",
"data": "Male"
}
There's a type annotation for 'data'.

Expected behavior
Shoudl read it as 'Gender.Male' for 'Data' property.

** Actual behavior**
It's failed.

It's also failing if we specify a @odata.type for a single resource for 'Data'.

@xuzhg xuzhg closed this as completed in a85f406 Jun 20, 2023
xuzhg added a commit that referenced this issue Dec 7, 2023
…h odata.type annotated (#2694)

* Fixes #2693: Does not work for reading value for untyped property with odata.type annotated

* Update src/Microsoft.OData.Core/ReaderValidationUtils.cs

Co-authored-by: John Gathogo <john.gathogo@microsoft.com>

* Add async test to verify the result

---------

Co-authored-by: John Gathogo <john.gathogo@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant