-
Notifications
You must be signed in to change notification settings - Fork 39
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
Double check handling of Go zero values #160
Comments
ANSI X9.100-187:
Bundle Control (Type 70)
Cash Letter Control Record (Type 90)
Check Detail Record (Type 25)
Check Detail Addendum A Record (Type 26)
Check Detail Addendum C Record (Type 28)
File Control Record (Type 99)
Image View Analysis Record (Type 54)
Image View Data Record (Type 52)
Image View Detail Record (Type 50)
Return Record (Type 31)
Return Addendum A Record (Type 32)
Return Addendum B Record (Type 33)
Return Addendum D Record (Type 35)
User Record (Type 68)–Format Type 001 Payee Endorsement Record
|
For the |
@intricate We can probably handle that field pretty simply. One of the reasons I haven't started working on this issue is that fixing all of these fields will require breaking changes. I've been debating whether we should use pointers to primitive types (i.e. For |
@atonks2 Daniel, is there any progress on this? We are trying out this library for the first time and looks really good, but we are currently having to comment out some checks in order to verify our testing. Thanks |
@smithbk Unfortunately I haven't been able to make progress on this yet. Would you mind sharing which checks you're having to disable? Perhaps with such a list we'd be able to prioritize specific fields and tackle this in multiple smaller PRs. |
@atonks2 Daniel, here are the checks I've had to comment out for now. In imageViewDetail.go:
And in ReturnDetailAddendumA.go:
Thanks, |
@atonks2 Daniel, could you provide an estimate of when this might be fixed? Thanks |
Hey @smithbk . I'm afraid I don't have an estimate on this one. Updating ICL to better handle default vs empty values is almost certainly going to be a breaking change and I haven't had time to give it the consideration it needs to minimize that impact. I started digging into the fields you mentioned and I don't believe they relate to this issue. The scope of this issue is optional fields, which are erroneously flagged as invalid because of Go's default (aka "zero") values. For example you may have a file where For the fields/checks you mentioned: Digital Signature MethodThe specification says this is conditional, and our library only performs validation on this field if a value is present. If Image Creator Routing NumberThis is defined as a mandatory field in ANSI-X9.100-187, so our library returns an error if the field is missing/invalid. Image Creator DateThis is also a mandatory field, so omitting it will result in an error. BOFD/Endorsement DateAlso a mandatory field. If any of the above is a misunderstanding on my part, or you have a version of the specification that differs in these field definitions from ANSI-X9.100-187 (2016), lets open new issues to address those concerns. |
@atonks2 Daniel, in order to not introduce any breaking changes, I'm curious if you've considered (and if it would work) to add "HasXXX" bool fields for each of these problematic fields. For example, for |
I appreciate the suggestion @smithbk. That would work for people importing this codebase as a library to construct files, but would not work for those using the API to upload raw x9 files. The two options I have in mind each come with their own pros and cons:
|
Due to the nature of Go's zero values, x9 files created from JSON can end up with
0
s and emptytime.Time{}
values in them. We need to ensure that we're not accidentally writing zero values in x9 files where a field should actually be empty.The text was updated successfully, but these errors were encountered: