Skip to content

Commit

Permalink
Merge pull request #26 from KavinduZoysa/trim-message
Browse files Browse the repository at this point in the history
Trim messages before compare
  • Loading branch information
KavinduZoysa committed Oct 25, 2023
2 parents 1e43734 + 042fcee commit 1fa5ee4
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 1fa5ee4

Please sign in to comment.