Giter Site home page Giter Site logo

Comments (5)

dkubb avatar dkubb commented on July 23, 2024

Does the Object type not work for you?

from dm-types.

nevir avatar nevir commented on July 23, 2024

Hmm, well, my use case is to ensure that the data is JSON-encoded for portability (other systems in other languages want to read the data). Too specific of a use case for dm-types? That and I have an aversion to storing marshaled data and would rather deal with explicitly versioning it (as a general statement about Object-based properties).

So, all I really want is a Json field that ensures a Hash and exposes the property as a Mash.

from dm-types.

dkubb avatar dkubb commented on July 23, 2024

@solnic what do you think? too specific for dm-types? I'm leaning that way but I wanted to get your input first.

from dm-types.

solnic avatar solnic commented on July 23, 2024

@nevir actually I think a better idea would be to extend existing Json property rather than adding a new one.

from dm-types.

jpr5 avatar jpr5 commented on July 23, 2024

The more I work with the Json property type, the more I think it's a real mistake that it doesn't use a Mash/HashWithIndifferentAccess.

Simply: the property allows you to set keys of symbol (or string) type. Until the property is persisted, you'll even be able to interact with the symbol keys. The moment you persist/reload, that behavior changes. This really doesn't seem to follow the "it behaves how I'd expect" principle, given what it's supposed to represent, nor the "it behaves consistently" principle.

Seems like "it should work" would be a far more common case than "it shouldn't work/I'd want it to error out". And, FWIW, preventing symbol keys from being used in the first place would feel pedantically heavy-handed on the positive side, outright retarded on the negative.

from dm-types.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.