feat(routing): validation for configs#10133
Merged
likhinbopanna merged 7 commits intomainfrom Nov 10, 2025
Merged
Conversation
Changed Files
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10133 +/- ##
=======================================
Coverage ? 3.89%
=======================================
Files ? 1224
Lines ? 303434
Branches ? 0
=======================================
Hits ? 11804
Misses ? 291630
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sarthak1799
requested changes
Nov 5, 2025
jagan-jaya
previously approved these changes
Nov 6, 2025
Sarthak1799
reviewed
Nov 7, 2025
Sarthak1799
approved these changes
Nov 7, 2025
jagan-jaya
approved these changes
Nov 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Tagged Issue
juspay/hyperswitch-cloud/issues/11764
Description
This pull request introduces validation logic for routing configuration objects and improves error handling for dynamic routing setup. The main changes ensure that required fields are present in routing configs and provide clearer error messages when configurations are missing or invalid.
Routing Configuration Validation
validatemethod toEliminationRoutingConfigandSuccessBasedRoutingConfigto check that at least one required field is present; returns a validation error if all fields are null. [1] [2]Error Handling Improvements
create_specific_dynamic_routing_setupto call the newvalidatemethods and return a specific error if the configuration is invalid, with a clear message about missing fields. [1] [2]link_routing_configto distinguish between not-found and internal server errors, providing more descriptive error contexts.Code Maintenance
fp_utilsto imports incrates/api_models/src/routing.rsto support the new validation logic.Routing Algorithm Logic
DynamicRoutingAlgorithmRefto return false ifalgorithm_idis missing, ensuring more robust feature checks.How did you test it?
create success_based with empty payload
activate routing algo without descision_engine_config
Checklist
cargo +nightly fmt --allcargo clippy