Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consideration: if data within the write context is empty, perhaps omit the field entirely #359

Closed
edaniszewski opened this issue Feb 4, 2020 · 2 comments
Labels

Comments

@edaniszewski
Copy link
Contributor

e.g., if we issue a write and the reflected context is something along the lines of

[
  {
    "id": "2b717ced-58ff-43dc-ab6f-d4c0c6008ebb",
    "device": "f041883c-cf87-55d7-a978-3d3103836412",
    "context": {
      "action": "color",
      "data": "f38ac2",
      "transaction": ""
    },
    "timeout": "30s"
  }
]

we could omit the empty transaction

[
  {
    "id": "2b717ced-58ff-43dc-ab6f-d4c0c6008ebb",
    "device": "f041883c-cf87-55d7-a978-3d3103836412",
    "context": {
      "action": "color",
      "data": "f38ac2",
    },
    "timeout": "30s"
  }
]

not totally necessary, but reducing the amount of "empty" data does make it a bit more easy to parse visually.

this is open for discussion/opinions/thoughts

@marcoceppi
Copy link
Contributor

The thing that tripped me up the most was the fact transaction was a blank string instead of null. I like the idea of omitting context that wasn't explicitly passed but I can see the value in having it explicitly stated. Especially now that I understand more what this field provides.

@MatthewHink
Copy link
Contributor

Same here.

One way may be to make the context[transaction]: "id"

That would be plainer than empty, but may not be the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants