Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutually-exclusive requirements in schema should translate into cpp object population code #41

Open
tanaya-mankad opened this issue May 17, 2024 · 0 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@tanaya-mankad
Copy link
Contributor

Currently, a requirement such as

regular_interval:
      Description: Duration of regular interval
      Data Type: Numeric
      Units: s
      Constraints: ">0"
      Required: "if !timestamps"
timestamps:
      Description: Array of timestamps
      Data Type: "[Timestamp][1..]"
      Required: "if !regular_interval"

translates as:

json_get<double>(j, "regular_interval", x.regular_interval, x.regular_interval_is_set, true);
json_get<std::vector<std::string>>(j, "timestamps", x.timestamps, x.timestamps_is_set, true);

which doesn't take into account the mutual exclusivity.

@tanaya-mankad tanaya-mankad self-assigned this May 17, 2024
@tanaya-mankad tanaya-mankad added the invalid This doesn't seem right label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant