Skip to content

Conversation

@kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Jun 6, 2023

Currently, tests are failing due to visitor going more than one level deep and nested objects effectively getting top-level key assigned to them.

Or rather, after more investigation, it simply puts a type field into the flattened other map, as type is not removed; it normally is, as it's used as tag = "type" during deserialization.

tl;dr - we want both variants to be deserializable (currently first example is failing due to missing type key):

{
  "contexts": {
    "device": {
      "name": "fancy name for a fancy server",
      "arch": "amd64",
      "num_cpu": 8
    },
}
{
  "contexts": {
    "device": {
      "type": "device",
      "name": "fancy name for a fancy server",
      "arch": "amd64",
      "num_cpu": 8
    },
}

Closes #483

@kamilogorek kamilogorek force-pushed the scope-transactions branch from 04de6af to 161e98a Compare June 7, 2023 12:00
Copy link
Contributor

@loewenheim loewenheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, that's pretty gnarly. Respect for getting this done.

@kamilogorek kamilogorek merged commit 4b886a8 into master Jun 7, 2023
@kamilogorek kamilogorek deleted the scope-transactions branch June 7, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context inferred "type" field not being respected

3 participants