fix: Allow for Contexts data type to be infered from the key value #588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 atypefield into the flattenedothermap, astypeis not removed; it normally is, as it's used astag = "type"during deserialization.tl;dr - we want both variants to be deserializable (currently first example is failing due to missing
typekey):{ "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