Does anybody know why
@[JSON::Field] was chosen?
JSON standard itself doesn’t seem to define how to call names on the left in JSON object.
I understand that
@[JSON::Field] is short and is most googleable. I’ve tried googling JSON field, JSON property, and JSON attribute and they seem to be in use in this order.
I’m searching GitHub issues and PRs and can’t find where the decision to use
JSON::Serializable was made. Other discussed options seem to be at least
I wonder if
@[JSON::Property] is more coherent with normal Crystal
@[JSON::Serializable] class Point @[JSON::Property] property x : Int32 @[JSON::Property] property y : Int32 end
@[JSON::Field] being short, but
@[JSON::Property] seem to be closer to Crystal, and also maybe more universal if formats other that JSON considered (