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

Migrate from Newtonsoft to System.Text.Json #91

Merged

Conversation

shubham1172
Copy link
Member

@shubham1172 shubham1172 commented Apr 3, 2023

Co-Authored by: @ASHIQUEMD (Generic Converter for State Binding from #90)

This PR updates the codebase to use STJ (System.Text.Json) instead of Newtonsoft. There are a few updates

  • Instead of JToken, all internal classes use JsonElement (STJ) for storing data, along with a custom JsonElementConverter that converts with UnsafeRelaxedJsonEscaping.
  • The APIs support both STJ and NS as method parameters - this is because the underlying functions framework does not support expressions using STJ
  • The method return type and all internals are STJ based only
  • Update CloudEvents to 2.6.0
  • Add Generic Converter base class for converting JsonElement to T types
  • Add new tests

Closes #9

shubham1172 and others added 13 commits April 3, 2023 13:31
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: MD Ashique <noorani.ashique5@gmail.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
@shubham1172 shubham1172 changed the title [WIP] Migrate from Newtonsoft to System.Text.Json Migrate from Newtonsoft to System.Text.Json Apr 5, 2023
@shubham1172 shubham1172 marked this pull request as ready for review April 5, 2023 12:07
@ASHIQUEMD ASHIQUEMD self-requested a review April 5, 2023 16:23
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Copy link
Collaborator

@ASHIQUEMD ASHIQUEMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shubham1172 shubham1172 merged commit 1f8e283 into Azure:master Apr 6, 2023
ASHIQUEMD added a commit to ASHIQUEMD/azure-functions-dapr-extension that referenced this pull request Apr 6, 2023
Migrate from Newtonsoft to System.Text.Json (Azure#91)
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.

Use System.Text.Json instead of Newtonsoft
2 participants