Skip to content

Commit

Permalink
Trim messages before compare
Browse files Browse the repository at this point in the history
  • Loading branch information
KavinduZoysa committed Oct 25, 2023
1 parent 1e43734 commit 042fcee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ballerina/segment_group_reader.bal
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ isolated function readSegmentGroup(EdiUnitSchema[] currentUnitSchema, EdiContext
string[] fields = check splitFields(segmentDesc, ediSchema.delimiters.'field, segSchema);
if segSchema is EdiSegSchema {
log:printDebug(string `Trying to match with segment mapping ${printSegMap(segSchema)}`);
if segSchema.code != fields[0] {
if segSchema.code != fields[0].trim() {
check ignoreSchema(segSchema, sgContext, context);
continue;
}
Expand All @@ -69,7 +69,7 @@ isolated function readSegmentGroup(EdiUnitSchema[] currentUnitSchema, EdiContext
if firstSegSchema is EdiSegGroupSchema {
return error Error("First item of segment group must be a segment. Found a segment group.\nSegment group: " + printSegGroupMap(segSchema));
}
if firstSegSchema.code != fields[0] {
if firstSegSchema.code != fields[0].trim() {
check ignoreSchema(segSchema, sgContext, context);
continue;
}
Expand Down

0 comments on commit 042fcee

Please sign in to comment.