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

Use get / get_ref for nlohmann::json objects passed as parameters with different types #297

Open
2 tasks
alanking opened this issue Jan 14, 2025 · 0 comments
Open
2 tasks
Labels
Milestone

Comments

@alanking
Copy link
Contributor

alanking commented Jan 14, 2025

  • main
  • 4-3-stable

All of the parameters seen in these code snippets are being implicitly cast from nlohmann::json objects to the respective types of the receiving parameters:

return apply_data_movement_policy(
comm,
plugin_instance_name,
rule_obj["object-path"],
rule_obj["user-name"],
rule_obj["user-zone"],
rule_obj["source-replica-number"],
rule_obj["source-resource"],
rule_obj["destination-resource"],
rule_obj["preserve-replicas"],
rule_obj["verification-type"]);
});

return apply_tier_group_metadata_policy(
st,
rule_obj["group-name"],
rule_obj["object-path"],
rule_obj["user-name"],
rule_obj["user-zone"],
rule_obj["source-replica-number"],
rule_obj["source-resource"],
rule_obj["destination-resource"]);
});

These should be using the nlohmann::json::get or nlohmann::json::get_ref template functions with the explicit types specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant