databricks-cli/cmd/account
Andrew Nester f0e2981596
Added JSON input validation for CLI commands (#1771)
## Changes
Added JSON input validation for CLI commands. Now when invalid JSON
passed as a payload to CLI commands, CLI performs input normalisation
and detects if there are any mismatches such as incorrect types, unknown
fields and etc.

This diagnostic information is printed in standard error output and does
not block command execution, so the change is backward compatible.

Fixes #1769 #1764 #1625 #1560


## Tests
Added unit tests

```
andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti}'
Error: error decoding JSON at (inline):1:2: unexpected EOF


andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti": true}'
Warning: unknown field: seeti
  in (inline):1:9

Error: Job settings must be specified.
```

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2024-10-11 14:39:53 +00:00
..
access-control Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
billable-usage Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
budgets Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
credentials Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
csp-enablement-account Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
custom-app-integration Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
disable-legacy-features Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
encryption-keys Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
esm-enablement-account Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
groups Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
ip-access-lists Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
log-delivery Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
metastore-assignments Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
metastores Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
network-connectivity Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
networks Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
o-auth-published-apps Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
personal-compute Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
private-access Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
published-app-integration Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
service-principal-secrets Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
service-principals Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
settings Upgrade to Go SDK 0.47.0 (#1799) 2024-10-01 10:44:47 +00:00
storage Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
storage-credentials Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
usage-dashboards Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
users Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
vpc-endpoints Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
workspace-assignment Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
workspaces Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
cmd.go Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
groups.go Remove dependency on global state in generated commands (#595) 2023-07-25 20:19:07 +02:00