Skip to content

Conversation

@fira42073
Copy link

@fira42073 fira42073 commented Oct 14, 2025

Fixes Or Enhances

#1471

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@fira42073 fira42073 requested a review from a team as a code owner October 14, 2025 09:29
@fira42073 fira42073 changed the title feat: add test to check for bic that's only valid under 2022 specification Support for ISO 9362:2022 BIC (SWIFT) codes Oct 14, 2025
@fira42073 fira42073 force-pushed the bic-iso-9362-2022 branch 2 times, most recently from 4cf1a87 to 664102b Compare October 14, 2025 09:54
@coveralls
Copy link

coveralls commented Oct 14, 2025

Coverage Status

coverage: 73.737% (+0.007%) from 73.73%
when pulling 7d20e69 on fira42073:bic-iso-9362-2022
into 6a38036 on go-playground:master.

@nodivbyzero
Copy link
Contributor

Would it be better to introduce a new validator, such as bic_iso_9362, rather than modifying the existing one? This approach would preserve backward compatibility and ensure that current functionality remains unaffected.

@fira42073
Copy link
Author

sounds good, I can do that, but fyi https://www.iso.org/standard/60390.html the standard is withdrawn, and the 2022 one is inclusive of all old BICs from 2014 one. but if we are to proceed with the namespaced versions, how should we distinguish 2014 and 2022 ones? bic_iso_9362_2014 and bic_iso_9362_2022?

@nodivbyzero
Copy link
Contributor

Another option is to rename the existing one to bic_iso_9362_2014 and keep your current changes. We can also add a note/comment in the documentation to clarify this distinction.

@fira42073
Copy link
Author

@nodivbyzero Please check at your convenience C:
Thanks!!

@nodivbyzero
Copy link
Contributor

@fira42073
Looks great! Just need to update one more place, then it's ready to merge.

validator/doc.go

Lines 1381 to 1386 in 6a38036

BIC (SWIFT code)
This validates that a string value is a valid Business Identifier Code (SWIFT code), defined in ISO 9362.
More information on https://www.iso.org/standard/60390.html
Usage: bic

@fira42073
Copy link
Author

Added, thanks!
@nodivbyzero

@fira42073
Copy link
Author

rebased master, but lint is failing for some reason 😕

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

Successfully merging this pull request may close these issues.

3 participants