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

Add support for top level JsonElement values #3166

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

habbes
Copy link
Contributor

@habbes habbes commented Jan 17, 2025

Issues

This pull request fixes #3162

Description

The was that we didn't support extracting type name from the ODataJsonElementValue for the context URL when writing top-level properties. This PR handles that as follows:

  • for primitives, use the corresponding Edm primitive type name. For numbers, this returns Edm.Double since we can't be use of the numerical type (int32, double, decimal, etc.?) based on the value kind alone.
  • for arrays and objects, return Edm.Untyped. This can be problematic and needs to be re-evaluated to see if there's a better option.
  • for null, throw an exception by default since top-level nulls are not supported by default, but with the right compatibility flag, we can return Edm.Null (TODO: add test for the latter case)

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

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

Successfully merging this pull request may close these issues.

Writing top-level property with ODataJsonElementValue fails with exception stream value not supported
1 participant