Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation schemas not correctly validating when writing EDI #286

Closed
MikeEdgar opened this issue Jul 22, 2022 · 0 comments · Fixed by #425
Closed

Implementation schemas not correctly validating when writing EDI #286

MikeEdgar opened this issue Jul 22, 2022 · 0 comments · Fixed by #425

Comments

@MikeEdgar
Copy link
Member

I'm running validation with the xml stream writer -- but it seem only be validating using the transaction.xml and not the implementation.xml
For example:
I have this in my Transaction.xml

                     .....
            <loop code="Loop1000" minOccurs="1" maxOccurs="4" >
                <sequence>
                    <segment type="N1"/>
                    <loop code="Loop1100" maxOccurs="1">
                        <sequence >
                            <segment type="ACT" minOccurs="1" />
                        </sequence>
                    </loop>
                </sequence>
            </loop>
            <loop name="Loop2000"  code="Loop2000" type="Loop2000"  maxOccurs="9999">
                <sequence>
                    <segment type="INS" minOccirs="1"/>
                     .....

and i have this, in my Implementaion.xml (I have a B and C Loop1000 as well.. with a minOccurs=0, the A loop is the only one required)

            <loop  title="Loop1000A" typeId="Loop1000A" code="Loop1000A" type="Loop1000" discriminator="1" minOccurs="1" maxOccurs="1">
                <sequence>
                    <segment type="N1" title="Sponsor Name"  minOccurs="1" description="1000">
                        <sequence>
                            <element position="1" title="Entity Identifier Code (Sponsor)" minOccurs="1">
                                <enumeration>
                                    <value>P5</value>
                                </enumeration>
                            </element>
                            <element position="2" minOccurs="0"/>
                            <element position="3" minOccurs="1"/>
                            <element position="4" minOccurs="1"/>
                        </sequence>
                    </segment>
                </sequence>
            </loop>

when I validate my transaction that has the B and C loop -- validation passes ,unexpectedly, since there is no matching 1000A loop.
if I remove the B and C loops as well.. then it fails. Not exactly as expected.. since I get the error on the next segment
Encountered SEGMENT_ERROR [MANDATORY_SEGMENT_MISSING] in segment INS --> the INS segment exists, its the first segment after the 1000 loop... it's the Loop1000 that's missing... but at least it fails .

My question is -- should the validation be performed using the implementation schema? Or is my expectation not correct?
Should the validation message indicate that it's the Loop1000 that's missing (as opposed to the INS)?

Originally posted by @d-floyd in #284

@MikeEdgar MikeEdgar added this to the v2.0.0 milestone Apr 20, 2023
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Apr 28, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Apr 30, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Apr 30, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue May 4, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue May 16, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue May 18, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Jun 22, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Sep 9, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Oct 24, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 6, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 7, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 7, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 8, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 15, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
MikeEdgar added a commit to MikeEdgar/staedi that referenced this issue Dec 24, 2023
Fixes xlate#283
Fixes xlate#286

Signed-off-by: Michael Edgar <michael@xlate.io>
@MikeEdgar MikeEdgar modified the milestones: v2.0.0, v1.24.1 Dec 30, 2023
@MikeEdgar MikeEdgar changed the title Add support for implementation schemas when writing EDI Implementation schemas not correctly validating when writing EDI Dec 30, 2023
@MikeEdgar MikeEdgar removed this from the v1.24.1 milestone Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant