Crystal: [RFC] Remove JSON.mapping and YAML.mapping

Created on 3 Oct 2019  路  4Comments  路  Source: crystal-lang/crystal

Now that we have JSON::Serializable and YAML::Serializable I think we should remove JSON.mapping and YAML.mapping as usual: first deprecate them (warning), then remove them.

I believe the Serializable approach is superior:

  • it just generates a constructor (mapping will generate getters and setters too, from which you can opt-out, but it feels a bit messy)
  • it's DRY: with mapping you need to specify the type of instance vars, and you have to do this if you have multiple mappings (like JSON and YAML in a single class)
  • it supports inheritance but mapping doesn't

I'd like to deprecate mapping in 0.32.0 and remove it in 0.33.0.

discussion topicserialization

Most helpful comment

If someone want's to preserve this in a shard, this is fine. But I don't think we should burden crystal-lang with it.

All 4 comments

It might be worth making extracting it to a shard and keeping it in the crystal-lang org for a little while.

If someone want's to preserve this in a shard, this is fine. But I don't think we should burden crystal-lang with it.

Maybe the crystal-community would be a good place.

This seems like something that people might want for compatibility for a while. It does not seems like something that was inherently done wrong. I just thing it might be worth preserving for people keeping up with crystal releases and some people might prefer it.

Yes as a shard but not inside the organization (it's fine in crystal-community though... I _think_).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ezrast picture ezrast  路  84Comments

HCLarsen picture HCLarsen  路  162Comments

RX14 picture RX14  路  62Comments

MakeNowJust picture MakeNowJust  路  64Comments

akzhan picture akzhan  路  67Comments