Skip to content

Commit

Permalink
Merge pull request #572 from alexppxela/validation/fixt-reject-invali…
Browse files Browse the repository at this point in the history
…d-message

Check RejectInvalidMessage on FIXT validation
  • Loading branch information
ackleymi authored Aug 7, 2023
2 parents 3a023ca + 60dde05 commit ab15e58
Show file tree
Hide file tree
Showing 4 changed files with 435 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ E8=FIXT.1.19=6735=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=2113
#------------------------

#New order message with incorrect repeating group "count". NoTradingSessions (386)
I8=FIXT.1.135=D34=249=TW52=<TIME>56=ISLD11=ID21=140=154=138=200.0055=INTC386=3336=PRE-OPEN336=AFTER-HOURS60=<TIME>
I8=FIXT.1.135=D34=249=TW52=<TIME>56=ISLD11=ID21=140=154=138=200.0055=INTC386=3336=3336=660=<TIME>
# expect a reject
E8=FIXT.1.19=12535=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=Incorrect NumInGroup count for repeating group371=386372=D373=1610=0

Expand All @@ -23,4 +23,4 @@ E8=FIXT.1.19=12535=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=Incor
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ E8=FIXT.1.19=6735=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=2113
#------------------------

#New order message with incorrect repeating group "count". NoTradingSessions (386)
I8=FIXT.1.135=D34=249=TW52=<TIME>56=ISLD11=ID21=140=154=138=200.0055=INTC386=3336=PRE-OPEN336=AFTER-HOURS60=<TIME>
I8=FIXT.1.135=D34=249=TW52=<TIME>56=ISLD11=ID21=140=154=138=200.0055=INTC386=3336=3336=660=<TIME>
# expect a reject
E8=FIXT.1.19=12535=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=Incorrect NumInGroup count for repeating group371=386372=D373=1610=0

Expand All @@ -23,4 +23,4 @@ E8=FIXT.1.19=12535=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=Incor
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
12 changes: 7 additions & 5 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ func validateFIXT(transportDD, appDD *datadictionary.DataDictionary, settings Va
}
}

if err := validateWalk(transportDD, appDD, msgType, msg); err != nil {
return err
}
if settings.RejectInvalidMessage {
if err := validateFields(transportDD, appDD, msgType, msg); err != nil {
return err
}

if err := validateFields(transportDD, appDD, msgType, msg); err != nil {
return err
if err := validateWalk(transportDD, appDD, msgType, msg); err != nil {
return err
}
}

return nil
Expand Down
Loading

0 comments on commit ab15e58

Please sign in to comment.