cedar-policy / cedar-java

Java bindings for the Cedar language
https://www.cedarpolicy.com
Apache License 2.0
42 stars 19 forks source link

update policy serialization #178

Closed khieta closed 3 months ago

khieta commented 3 months ago

Issue #, if available:

Description of changes:

cedar#1041 uncovered a bug in #173 😱 ValidationRequest objects were being serialized as { "schema":..., "policies": ..., "policySet": ...} where the policies and policySet values were identical. This PR gets rid of the unwanted policySet field.

khieta commented 3 months ago

I don't understand how this fixes anything

Also mysterious to me. But it appears that Jackson was getting two different names from the getter (getPolicySet) and the class field (policies). And instead of warning or failing to build, it decided that we must want both fields.