Skip to content

JsonSerializer does not respect Culture when deserializing primitive types#1606

Merged
alexeyzimarev merged 1 commit intorestsharp:devfrom
Georgiks:dev
Jul 15, 2021
Merged

JsonSerializer does not respect Culture when deserializing primitive types#1606
alexeyzimarev merged 1 commit intorestsharp:devfrom
Georgiks:dev

Conversation

@Georgiks
Copy link
Copy Markdown
Contributor

@Georgiks Georgiks commented Jul 7, 2021

Description

When deserializing any primitive type (floating point types especially), the JsonSerializer uses Convert.ChangeValue without passing Culture property, which results in using CurrentCulture as default.
I don't seem to find any other effective way how to enforce the RestSharp to deserialize primitive value using using custom Culture.

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@alexeyzimarev alexeyzimarev merged commit 80e23bc into restsharp:dev Jul 15, 2021
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.

2 participants