Skip to content

[BUG] Marshalling eval.Flags struct to JSON triggers "invalid JSON file" error #246

@skyerus

Description

@skyerus

Observed behavior

While implementing caching integration tests I needed to make changes to the flagd JSON configuration file at runtime. As such, I parsed the existing configuration file, made changes to the structure and wrote it back to the file. This results in the error "set state: invalid JSON file".

This is due to the targeting property not being valid if set to null. Marshalling the eval.Flags struct sets any empty Targeting fields to null. The solution is to add omitempty to the json tags of this field.

Expected Behavior

Marshalling eval.Flags to JSON is valid for use as configuration.

Steps to reproduce

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions