Feature Request
JSON::Serializable and YAML::Serializable contain this field properties to ignore serialization/deserialization, URI::Params::Serializable could also have them to use them with something like this (crystal spec):
struct A
include URI::Params::Serializable
property name : String
property age : Int32?
def initialize(@name : String, @age : Int32? = nil)
after_initialize
end
@[URI::Params::Field(ignore: true)]
property msg : String?
def after_initialize
@msg = "Hello " + name
end
end
person = A.new("Vasya", 30)
person.msg.should eq "Hello Vasya"
person.to_www_form.should eq "name=Vasya&Age=30"
A.from_www_form(person.to_www_form).msg.should eq "Hello Vasya"
Currently, with that small spec code, A.from_www_form(person.to_www_form).msg.should eq "Hello Vasya" will actually equal to "name=Vasya&age=30&msg=Hello+Vasya" since property @msg is not ignored.
Add a 👍 reaction to issues you find important.
Feature Request
JSON::SerializableandYAML::Serializablecontain this field properties to ignore serialization/deserialization,URI::Params::Serializablecould also have them to use them with something like this (crystal spec):Currently, with that small spec code,
A.from_www_form(person.to_www_form).msg.should eq "Hello Vasya"will actually equal to"name=Vasya&age=30&msg=Hello+Vasya"since property@msgis not ignored.Add a 👍 reaction to issues you find important.