json icon indicating copy to clipboard operation
json copied to clipboard

IPAddr#to_json remove prefix address with CIDR

Open taketo1113 opened this issue 2 years ago • 0 comments

IPAddr#to_json removed the prefix address with IPAddr/CIDR value. It unable to deserialize IPAddr/CIDR value.

Expected behavior

require 'date'
require 'json'

IPAddr.new('172.16.0.0/24').to_json #=> "\"172.16.0.0/24\""

Actual behavior

require 'ipaddr'
require 'json'

IPAddr.new('172.16.0.0/24').to_json #=> "\"172.16.0.0\""

Related URL

  • https://github.com/rails/rails/issues/46006

taketo1113 avatar Sep 12 '22 15:09 taketo1113