fix: conversion of JsonObject to Constraint - #5939
Open
ndr-brt wants to merge 1 commit into
Open
Conversation
ndr-brt
force-pushed
the
5792-fix-serialization
branch
from
August 4, 2026 14:34
6f6b6c9 to
fdbda2a
Compare
wolf4ood
approved these changes
Aug 4, 2026
ronjaquensel
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR changes/adds
Add missing unwrapping of JsonValue types also when the input is a JsonArray.
Why it does that
Avoid weird serialized types when Constraing.rightOperand is an array
Further notes
THIS IS A BREAKING CHANGE: until 0.18.0, when a
rightOperandof aConstrainttype in aPolicyDefinitioncontained aList, it would got stored into database as something like:this because the incoming
JsonArrayfrom the API's json-ld was not unwrapped and the type was stored as it was.So, if in your control-plane do you have PolicyDefinitions with a multi-value
rightOperand, you should migrate every one of those into:It could become tricky to write an automatic script to do that, so our advice would be to update the affected policies with an API call passing the same bodies that were used to create them.
Please also note that if you adapted your policy functions to workaround this bug, you'll need to update them as well.
Who will sponsor this feature?
Please @-mention the committer that will sponsor your feature.
Linked Issue(s)
Closes #5792
Related to #5934
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.