Skip to content

Since unification is so generic, should 'null' values be omitted? #48

Open
@alaendle

Description

@alaendle

This is more a question that came to my mind will working with a relatively complex json file (following this schema: https://www.eclipse.org/unide/specification/v3/process-message/#messageDetail)

E.g. consider a simple example json like:

{
    "values": [{"a": "a"},{"b": "b"}]
}

Do we really want to write it back like:

{
    "values": [{"a": "a", "b": null},{"a": null, "b": "b"}]
}

A simple hack would be to just use this snippet to strip null value pairs before creating the object in to JSON (and remove the toEncoding implementation). If a PR is able to better explain my intention just let me know and I provide a draft.
https://gist.github.com/alanz/2465584#file-simple-hs-L21-L22

I know that this might start an endless discussion about the semantic of "null" - but that is not my point, I think a (great, thanks!) tool like json-autotype couldn't support any corner case; so I wondered what is the most pragmatic interpretation in such a case. And since I haven't found any related issue I created this one. But please feel free to just close this issue if you consider this thing as already discussed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions