auto_json:基于auto_constructor字段的类和结构的自动JSON转换

时间:2021-05-12 21:29:04
【文件属性】:
文件名称:auto_json:基于auto_constructor字段的类和结构的自动JSON转换
文件大小:15KB
文件格式:ZIP
更新时间:2021-05-12 21:29:04
Crystal 此项目已弃用,只需使用JSON :: Serializable模块即可。 auto_json 基于字段的类和结构的自动JSON转换 安装 将此添加到应用程序的shard.yml : dependencies : auto_json : github : kostya/auto_json 用法 require " auto_json " struct A include AutoJson field :a , Int32 field :b , String , default: " def " field :c , Int32 field :d , String ? field :e , Float64 end puts A .new( a: 1 , c: 3 , e: 1.0 ).to_json # => {"a":1,"b":"def",
【文件预览】:
auto_json-master
----.gitignore(140B)
----src()
--------auto_json.cr(5KB)
----example2.cr(591B)
----.travis.yml(18B)
----LICENSE(1KB)
----spec()
--------with_defaults_bool_spec.cr(902B)
--------emit_null_spec.cr(554B)
--------inheritance_spec.cr(2KB)
--------json_methods_spec.cr(636B)
--------complex_spec.cr(521B)
--------simple_spec.cr(741B)
--------nested_spec.cr(1KB)
--------nilable_and_default_spec.cr(2KB)
--------auto_expand_spec.cr(316B)
--------simple_edge_cases_spec.cr(614B)
--------with_defaults_spec.cr(950B)
--------enable_fields_spec.cr(2KB)
--------key_spec.cr(481B)
--------union_spec.cr(352B)
--------nested_data_spec.cr(810B)
--------std_mapping_spec.cr(11KB)
--------empty_spec.cr(212B)
--------after_initialize_spec.cr(397B)
--------spec_helper.cr(42B)
--------with_nilable_spec.cr(1KB)
----README.md(2KB)
----shard.yml(254B)
----example.cr(342B)

网友评论