Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Q quickfix
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • quickfixgo
  • quickfix
  • Merge requests
  • !115

Repeating group validation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/bhaan/repeating-group-validation into master Apr 23, 2016
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: bhaan

fixes #102 (closed)

problem

While "walking" over every field during message validation, each field is passed to validateVisitField to check and validate repeating groups if the current field happens to be the start of a repeating group. After checking the current field, it pops that field off the stack of remaining fields in the message.

When validating a repeating group, the starting field is passed to validateVisitGroupField which iterates over the remaining fields in the message, popping each field off the stack as it goes along.

Therefore, when the repeating group validation returns, validateVisitField will pop the current field off the stack of remaining fields, which is actually the next field in the message after the repeating group.

In the case of the MarketDataRequest message described in issue #102 (closed), there are two repeating groups placed back-to-back. The first being NoRelatedSym (tag 146), the second being NoMDEntryTypes (tag 267). So after validating the repeating group for tag 146, the next tag (267) is accidentally popped off the remaining field stack. This leaves the rest of the fields within the NoMDEntryTypes group on the field stack, and are then validated against the message definition for MarketDataRequest which doesn't contain the field type MDEntryType (tag 269). Resulting in the error: "Tag not defined for this message type"

solution

Simple. Don't pop the current field off the remaining field stack if it's the start of a repeating group, because validateVisitGroupField will do it for us.

tests

Coincidentally, the tests for validateVisitGroupField contained the scenarios needed to verify this behavior. Because the functions for validateVisitField and validateVisitGroupField have the same interface, and the former invokes the latter, I simply consolidated the two to call validateVisitField.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/bhaan/repeating-group-validation