Skip to content

fix#38

Merged
MichalFrends1 merged 2 commits into
mainfrom
fspw-799
Jun 11, 2026
Merged

fix#38
MichalFrends1 merged 2 commits into
mainfrom
fspw-799

Conversation

@MatteoDelOmbra

@MatteoDelOmbra MatteoDelOmbra commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Task Update PR template

Review Checklist

  • Task version updated (x.x.0)
  • CHANGELOG.md updated
  • Solution builds
  • Warnings resolved (if possible)
  • Typos resolved
  • Tests cover new code
  • Description how to run tests locally added to README.md (if needed)
  • All tests pass locally

Summary by CodeRabbit

  • Bug Fixes

    • Fixed null value handling for non-string element types (integers, booleans, decimals) in schema mode
    • Improved handling of nil/empty elements to properly clear type information when converting to null values
  • New Features

    • Enhanced schema mode to properly convert and parse non-string XML element types with correct JSON type mapping

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@MatteoDelOmbra, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 9 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 08eef967-1f47-4e92-881b-e35c6713bd23

📥 Commits

Reviewing files that changed from the base of the PR and between cf56923 and b1114a3.

📒 Files selected for processing (1)
  • Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md

Walkthrough

This PR fixes null-value conversion when xsi:nil="true" is applied to XML elements with non-string schema types. The ApplyXsiNil method now clears any xsi:type hint before collapsing the wrapper to JSON null. Two new unit tests validate nil and type-conversion behavior. Version bumped to 2.1.0 with changelog and project file updates.

Changes

Nil Handling for Non-String Types

Layer / File(s) Summary
ApplyXsiNil logic for clearing type hints
Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/ConvertXMLStringToJToken.cs
When xsi:nil="true" marks an empty element, the method now clears any detected xsi:type hint from the wrapper object before replacing or collapsing the wrapper to a JSON null value.
Test coverage for nil and non-string type handling
Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.Tests/UnitTests.cs
Two new schema-mode tests verify that empty elements with xsi:nil='true' and non-string types (int, boolean, double) convert to JToken null, and that non-empty elements with non-string types are typed and parsed correctly.
Version and release metadata
Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md, Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.csproj
CHANGELOG entry documents the nil-handling fix for version 2.1.0, project version updated from 2.0.0 to 2.1.0, and ItemGroup formatting adjusted for consistency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • FrendsPlatform/Frends.JSON2#37: This PR's change to clear xsi:type hints when xsi:nil="true" is set builds on the expanded xsi:type/XSD schema type handling introduced in the related PR.

Suggested reviewers

  • jefim
  • jannejjj

Poem

🐰 A nil with a type hint caused quite a fright,
But now we clear hints when nil marks the night,
Non-strings to null, with the wrapper collapsed—
Schema types tested and properly wrapped! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix' is extremely vague and does not convey meaningful information about the changeset. It fails to describe what is being fixed or the primary change in the pull request. Replace 'fix' with a descriptive title that summarizes the main change, such as 'Fix null handling for non-string types in Schema mode' or similar.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fspw-799

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md (1)

3-6: ⚡ Quick win

Make the changelog entry more specific.

The current description "Fix a case when we want to return null value for non-string types" is vague and doesn't explain the actual scenario being fixed. Based on the code changes and test coverage, the fix specifically addresses xsi:nil='true' handling for non-string schema types (int, boolean, double, etc.).

Consider revising to something more descriptive, such as:

  • "Fixed xsi:nil='true' handling for non-string schema types to properly return JSON null values"
  • "Fixed null-value conversion when xsi:nil='true' is applied to XML elements with non-string schema types"

This helps users understand exactly what scenario was fixed when reviewing the changelog. As per coding guidelines, changelog entries should include all functional changes with sufficient detail.

📝 Suggested changelog improvement
 ## [2.1.0] - 2026-06-11
 ### Fixed
-Fix a case when we want to return null value for non-string types.
+Fixed xsi:nil='true' handling for non-string schema types to properly return JSON null values.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md` around lines 3 - 6, Update
the changelog entry under "## [2.1.0] - 2026-06-11" to be specific about the
fix: replace the vague line with a clear description stating that xsi:nil='true'
handling for non-string schema types (e.g., int, boolean, double) now correctly
converts to JSON null; reference xsi:nil='true' and "non-string schema types" in
the sentence so users understand the exact scenario fixed.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md`:
- Around line 3-6: Update the changelog entry under "## [2.1.0] - 2026-06-11" to
be specific about the fix: replace the vague line with a clear description
stating that xsi:nil='true' handling for non-string schema types (e.g., int,
boolean, double) now correctly converts to JSON null; reference xsi:nil='true'
and "non-string schema types" in the sentence so users understand the exact
scenario fixed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3c52cb36-54bc-4498-aa09-52ba701e3c88

📥 Commits

Reviewing files that changed from the base of the PR and between 1c2dde2 and cf56923.

📒 Files selected for processing (4)
  • Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md
  • Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.Tests/UnitTests.cs
  • Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/ConvertXMLStringToJToken.cs
  • Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.csproj

@MichalFrends1 MichalFrends1 merged commit 3f6234e into main Jun 11, 2026
6 checks passed
@MichalFrends1 MichalFrends1 deleted the fspw-799 branch June 11, 2026 12:21
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