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

Different path length for same segment #223

Open
S3ph3r opened this issue Feb 23, 2022 · 3 comments
Open

Different path length for same segment #223

S3ph3r opened this issue Feb 23, 2022 · 3 comments

Comments

@S3ph3r
Copy link

S3ph3r commented Feb 23, 2022

I am currently using version 1.3.3 and during the upgrade to the current version I have encountered the following problem:

I have a message that contains the following sequence
SEQ+Z02'
CCI+Z17'
CAV+Z64'
CAV+Z63'
CCI+Z26++ZA8'
CAV+Z84'

I'm using the following code for the serializer:

[EdiSegment, EdiSegmentGroup("SEQ")]
public class SEQ_Z02_SegmentGroup
{
    [EdiCondition("Z17", Path = "CCI/0/0")]
    public CCI_CAV_SegmentGroup Attribute1 { get; set; }
    [EdiCondition("ZA8", Path = "CCI/2/0")]
    public CCI_CAV_SegmentGroup Atrribute2 { get; set; }
}

[EdiSegment, EdiSegmentGroup("CCI", SequenceEnd = "CCI")]
public class CCI_CAV_SegmentGroup
{
    [EdiValue("X(3)", Mandatory = false, Path = "CCI/0/0")]
    public string CCIAttribute1 { get; set; }
    [EdiValue("X(3)", Mandatory = false, Path = "CCI/1/0")]
    public string CCIAttribute2 { get; set; }
    [EdiValue("X(17)", Mandatory = false, Path = "CCI/2/0")]
    public string CCIAttribute3 { get; set; }
    [EdiValue("X(17)", Mandatory = false, Path = "CCI/2/1")]
    public string CCIAttribute4 { get; set; }
    [EdiValue("X(3)", Mandatory = false, Path = "CCI/2/2")]
    public string CCIAttribute5 { get; set; }
    [EdiValue("X(35)", Mandatory = false, Path = "CCI/2/3")]
    public string CCIAttribute6 { get; set; }
    public List<CAV_Komplett> CAVAttributes { get; set; }
}

With the old version this works fine but if I upgrade to a newer version the value "Z17" in the second line is found but not set in CCIAttribute1. I found two possibilities to make it work (but unfortunately they are not feasible for my use case):

  1. Drop Attribute2 from my class. As long as there are no other path length for the same segment this works with the current version
  2. Add additional delimiters to the second line. If I change the second line to CCI+Z17++', the value can be found with the newer version.

Is there any possbility to make different path values work for the same segment in EdiCondition?

@cleftheris
Copy link
Contributor

Hi @S3ph3r can you please try to provide with pull request that has a failing test in the tests project. It will make it easier to investigate and fix.

Also have you seen the use of wildcard paths?

@S3ph3r S3ph3r mentioned this issue Feb 24, 2022
@S3ph3r
Copy link
Author

S3ph3r commented Feb 24, 2022

Hi @cleftheris! Thanks for answering so quickly. I have added a pull request where I recreated the problem that I have encountered as well as the two mentioned "fixes".

@S3ph3r
Copy link
Author

S3ph3r commented Mar 10, 2022

@cleftheris I was wondering if you had a chance to look at the pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants