Add NativeJsonFieldMapper and JsonFieldMapperInput classes; update se… - #133
Conversation
…rvice collection to register new handlers
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA new JSON field mapping handler is introduced, providing a native adapter that parses incoming JSON data and applies field mapping rules to transform the data structure. Configuration is provided via a startup input class containing mapping rule definitions. Changes
Sequence DiagramsequenceDiagram
participant Client as Client
participant Handler as NativeJsonFieldMapper
participant Rules as Mapping Rules
participant JSON as JSON Data
Client->>Handler: Initialize with rules config
Handler->>Rules: Deserialize Rules from settings
Rules->>Handler: MappingRule[] loaded
Client->>Handler: Handle(XchangeFile)
Handler->>JSON: Parse input data as JSON
JSON->>Handler: JSON object created
Handler->>Rules: Filter & separate scalar/array rules
loop For each scalar rule
Handler->>JSON: Apply fixed value OR copy from source
JSON->>Handler: Field set
end
loop For each array rule group
Handler->>JSON: Iterate source array elements
loop Per element
Handler->>JSON: Construct output object
Handler->>JSON: Apply array rules with [*] indexing
end
end
Handler->>JSON: Serialize to string
Handler->>Client: Return new XchangeFile
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…rvice collection to register new handlers
Summary by CodeRabbit
Release Notes