Skip to content

fix: Handle boolean fields returned as strings#1015

Open
kailash-b wants to merge 1 commit into
masterfrom
feat/SDK-8724
Open

fix: Handle boolean fields returned as strings#1015
kailash-b wants to merge 1 commit into
masterfrom
feat/SDK-8724

Conversation

@kailash-b
Copy link
Copy Markdown
Contributor

@kailash-b kailash-b commented May 21, 2026

Changes

This PR adds a BooleanStringConverter to handle boolean fields that the Auth0 server may return as JSON strings (e.g., "true"/"false") instead of native JSON booleans.

  • Classes added:

    • BooleanStringConverter (src/Auth0.ManagementApi/Core/BooleanStringConverter.cs) - a JsonConverter<bool> that handles deserialization of both native JSON booleans and string-encoded booleans ("true", "false", case-insensitive). Serialization always writes native JSON booleans.
  • Classes modified:

    • JsonConfiguration (src/Auth0.ManagementApi/Core/JsonConfiguration.cs) - registered the new converter globally in JsonOptions.
  • Other:

    • Updated .fernignore to preserve the new converter and its tests from Fern code generation.

References

Testing

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.36%. Comparing base (88ea2e6) to head (09b69fd).

Files with missing lines Patch % Lines
...Auth0.ManagementApi/Core/BooleanStringConverter.cs 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1015      +/-   ##
==========================================
+ Coverage   31.35%   31.36%   +0.01%     
==========================================
  Files        2709     2710       +1     
  Lines      107737   107753      +16     
  Branches     6328     6330       +2     
==========================================
+ Hits        33782    33799      +17     
+ Misses      72185    72184       -1     
  Partials     1770     1770              
Flag Coverage Δ
authIntTests 2.98% <62.50%> (+<0.01%) ⬆️
mgmtIntTests 30.09% <81.25%> (+0.01%) ⬆️
unittests 0.31% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kailash-b kailash-b marked this pull request as ready for review May 21, 2026 06:59
@kailash-b kailash-b requested a review from a team as a code owner May 21, 2026 06:59
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.

1 participant