mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update config sanity check for xmldp
Before it included paths starting with prefixes other than ~*req which is incorrect.
This commit is contained in:
committed by
Dan Christian Bogos
parent
48f4ef1f90
commit
0ee816a3f0
@@ -521,7 +521,7 @@ func (cfg *CGRConfig) checkConfigSanity() error {
|
||||
// Find the minimum rule length for dynamic RSRParser within the field value.
|
||||
minRuleLength := math.MaxInt
|
||||
for _, parser := range field.Value {
|
||||
if !strings.HasPrefix(parser.Rules, utils.DynamicDataPrefix) {
|
||||
if !strings.HasPrefix(parser.Rules, utils.DynamicDataPrefix+utils.MetaReq) {
|
||||
continue
|
||||
}
|
||||
ruleLen := len(strings.Split(parser.Rules, utils.NestingSep))
|
||||
|
||||
@@ -888,6 +888,7 @@ func TestConfigSanityERsXmlRootPath(t *testing.T) {
|
||||
"flags": ["*dryrun"],
|
||||
"xml_root_path": "A.B",
|
||||
"fields":[
|
||||
{"tag": "VariableFldNoReq", "path": "*cgreq.VariableFldNoReq", "type": "*variable", "value": "~*vars.C", "mandatory": true},
|
||||
{"tag": "VariableFld", "path": "*cgreq.VariableFld", "type": "*variable", "value": "~*req.A.B.Value1", "mandatory": true},
|
||||
{"tag": "ComposedFld", "path": "*cgreq.ComposedFld", "type": "*composed", "value": "~*req.A.B.Value2", "mandatory": true},
|
||||
{"tag": "ComposedFld", "path": "*cgreq.ComposedFld", "type": "*composed", "value": "_", "mandatory": true},
|
||||
|
||||
Reference in New Issue
Block a user