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

fix(data): add user hint to use template flag when unsupported json array is detected #435

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

reubenmiller
Copy link
Owner

Since the --data flag currently does not support providing json arrays, provide a useful hint to users that they can just use the --template flag instead.

Below shows the error/hint shown to users.

$ c8y inventory create --data '["one"]' --dry

2025-02-16T19:58:58.857+0100    ERROR   commandError: invalid data type (array) provided on the 'data' flag. Currently only key/value or json objects are supported. Hint: Try using the 'template' flag instead

The above command can then be simply rewritten by replace --data with --template:

c8y inventory create --template '["one"]' --dry

Related to #432

@reubenmiller reubenmiller merged commit 5a95089 into v2 Feb 16, 2025
4 checks passed
@reubenmiller reubenmiller deleted the fix-add-hint-on-invalid-data branch February 16, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant