Added ConvertAsArrayPaths parameter#34
Conversation
WalkthroughThe pull request introduces a new feature to the Frends.JSON.ConvertXMLStringToJToken library, adding a Changes
Sequence DiagramsequenceDiagram
participant User
participant ConvertMethod
participant XMLParser
participant JTokenConverter
User->>ConvertMethod: Provide XML string and ConvertAsArrayPaths
ConvertMethod->>XMLParser: Parse XML
XMLParser-->>ConvertMethod: Return parsed XML
ConvertMethod->>JTokenConverter: Convert XML to JToken
ConvertMethod->>ConvertMethod: Check specified paths
ConvertMethod->>JTokenConverter: Force array conversion for specified paths
JTokenConverter-->>ConvertMethod: Return modified JToken
ConvertMethod-->>User: Return converted JToken
Possibly related issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/Definitions/Input.cs (1)
14-20: Add validation and improve documentationConsider enhancing the property with:
- Validation attributes to ensure valid JSONPath expressions
- Documentation clarifying that JSONPath format is expected
- Documentation explaining the behavior when paths don't match
/// <summary> - /// A list of XPath expressions that specify which XML elements should always be converted to arrays. + /// A list of JSONPath expressions that specify which XML elements should always be converted to arrays. + /// Paths that don't match any elements will be silently ignored. /// </summary> /// <example> /// new[] { "$.root.items.item" } /// </example> + [Description("JSONPath expressions to identify elements that should be treated as arrays")] public string[] ConvertAsArrayPaths { get; set; }Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md (1)
3-5: Improve changelog entryThe entry could be more descriptive and avoid word repetition:
## [1.2.0] - 2025-01-13 ### Added -Added ConvertAsArrayPaths parameter that specify which XML elements should be converted to arrays. +New ConvertAsArrayPaths parameter to ensure consistent array conversion for specified XML elements, even when they contain single items.🧰 Tools
🪛 LanguageTool
[duplication] ~4-~4: Possible typo: you repeated a word.
Context: ... Changelog ## [1.2.0] - 2025-01-13 ### Added - Added ConvertAsArrayPaths parameter that spec...(ENGLISH_WORD_REPEAT_RULE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md(1 hunks)Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.Tests/UnitTests.cs(1 hunks)Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/ConvertXMLStringToJToken.cs(2 hunks)Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/Definitions/Input.cs(1 hunks)Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.csproj(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken/Frends.JSON.ConvertXMLStringToJToken.csproj
🧰 Additional context used
🪛 LanguageTool
Frends.JSON.ConvertXMLStringToJToken/CHANGELOG.md
[duplication] ~4-~4: Possible typo: you repeated a word.
Context: ... Changelog ## [1.2.0] - 2025-01-13 ### Added - Added ConvertAsArrayPaths parameter that spec...
(ENGLISH_WORD_REPEAT_RULE)
| public string XML { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// A list of XPath expressions that specify which XML elements should always be converted to arrays. |
There was a problem hiding this comment.
So those are not really XPath :) Those are JSONPath you have here. So lets change the docs to say "...JSONPath expressions that specify which JSON elements..."
issue-33
Summary by CodeRabbit
New Features
ConvertAsArrayPathsparameter to allow specifying XML elements to be converted to arrays during XML to JSON conversion.Bug Fixes
Documentation
Version