Skip to content

Commit

Permalink
Ensure empty context from zed does not result in an empty object (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr authored Oct 18, 2024
1 parent acc41be commit 4aa697f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spicedb-common/src/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const convertRelationshipToString = (rel: Relationship) => {
let caveatString = '';
if (rel.caveat) {
caveatString = `[${rel.caveat.caveatName}${
rel.caveat.context ? `:${Struct.toJsonString(rel.caveat.context)}` : ''
rel.caveat.context && Object.keys(Struct.toJson(rel.caveat.context) ?? {}).length > 0 ? `:${Struct.toJsonString(rel.caveat.context)}` : ''
}]`;
}

Expand Down

0 comments on commit 4aa697f

Please sign in to comment.