Closed nihalgonsalves closed 6 years ago
Will take a look. The code that generates this is at https://github.com/razorpay/ifsc/blob/70080e3c44b6a76d8b2caca4c9a3bd154add9d22/scraper/scripts/methods.rb#L287-L307
I'm wondering if the script is exporting the wrong IFSC.json file :man_facepalming:
Running the generate scripts locally to debug this. Should have a fix + new release out by tomorrow.
Thanks for the report :+1:
Closed with https://github.com/razorpay/ifsc/releases/1.1.0
Still have to push the NPM/Ruby/Hex packages.
@nihalgonsalves Was about to publish 1.1.0 to hex.pm. Can you confirm the following output please? I was confused by the IFSC.json file showing up twice (priv and src):
mix hex.publish
Compiling 3 files (.ex)
Generated ifsc app
Building ifsc 1.1.0
Dependencies:
poison ~> 3.1 (app: poison)
httpoison ~> 0.13 (app: httpoison)
memoize ~> 1.2 (app: memoize)
App: ifsc
Name: ifsc
Files:
src/elixir/config/config.exs
src/elixir/lib/mix
src/elixir/lib/mix/tasks
src/elixir/lib/mix/tasks/copy_json.ex
src/elixir/lib/razorpay
src/elixir/lib/razorpay/ifsc
src/elixir/lib/razorpay/ifsc.ex
src/elixir/lib/razorpay/ifsc/data.ex
src/elixir/README.md
tests/elixir/ifsc_acceptance_test.exs
tests/elixir/ifsc_test.exs
tests/elixir/test_helper.exs
tests/validator_asserts.json
priv/ifsc-data
priv/ifsc-data/IFSC.json
priv/ifsc-data/banknames.json
priv/ifsc-data/sublet.json
src/IFSC.json
src/banknames.json
src/sublet.json
CONTRIBUTING.md
README.md
mix.exs
Description: A simple package by @razorpay to help you validate your IFSC codes. IFSC codes are bank codes within India
Version: 1.1.0
Build tools: mix
Licenses: MIT
Maintainers: Nihal Gonsalves <nihal@gonsalves.com>, Abhay Rana <contact@razorpay.com>
Links:
GitHub: https://github.com/razorpay/ifsc
Website: https://ifsc.razorpay.com/
Elixir: ~> 1.5
Before publishing, please read the Code of Conduct: https://hex.pm/policies/codeofconduct
Publishing package to public repository hexpm.
Proceed? [Yn]
Should be fine, just double check that the json files are the same. The hex.publish
alias should've copied the latest version to priv
.
Published: https://hex.pm/packages/ifsc/1.1.0
@captn3m0 When I added the Rubygem (https://github.com/razorpay/ifsc/pull/31), you said that the "lookup ranges" method should be removed as it is no longer supported (https://github.com/razorpay/ifsc/pull/31#issuecomment-317964916)
We've had problems validating IFSC codes in production and investigating it lead me to the JSON file, which still includes 219 instances of range tuples (
\[\d*,\d*\]
) and thus it seems that the validation errors are due to missing range support in the Elixir package and Rubygem.Are these invalid branches, or should range validation be added? The API, PHP package, and NPM package all validate ranges correctly at the moment.
e.g. this Allahabad bank code that falls within the
[212820,212826]
range in theIFSC.json
fileAlso, the sole range test in
validator_asserts.json
does not really test a range:That IFSC code is actually stored plainly like this:
Which leads me to believe - is the scraper script the problem instead, as it isn't resolving all the ranges correctly to plain arrays?