databricks-cli/cmd/workspace
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
..
alerts Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
alerts-legacy Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
apps Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
artifact-allowlists Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
automatic-cluster-update Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
catalogs Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
clean-rooms Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
cluster-policies Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
clusters Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
compliance-security-profile Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
connections Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
consumer-fulfillments Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
consumer-installations Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
consumer-listings Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
consumer-personalization-requests Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
consumer-providers Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
credentials-manager Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
current-user Update Go SDK to v0.34.0 (#1256) 2024-03-06 09:53:44 +00:00
dashboard-widgets Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
dashboards Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
data-sources Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
default-namespace Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
disable-legacy-access Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
enhanced-security-monitoring Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
experiments Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
external-locations Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
functions Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
genie Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
git-credentials Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
global-init-scripts Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
grants 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
instance-pools Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
instance-profiles 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
jobs Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
lakeview Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
libraries 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
model-registry Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
model-versions Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
notification-destinations Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
online-tables Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
permission-migration Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
permissions Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
pipelines Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
policy-compliance-for-clusters Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
policy-compliance-for-jobs Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
policy-families Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
provider-exchange-filters Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-exchanges Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-files Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-listings Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-personalization-requests Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-provider-analytics-dashboards Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
provider-providers Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
providers Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
quality-monitors Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
queries Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
queries-legacy Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
query-history Bump github.com/databricks/databricks-sdk-go from 0.44.0 to 0.45.0 (#1719) 2024-08-27 08:54:05 +00:00
query-visualizations Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
query-visualizations-legacy Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
recipient-activation Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
recipients Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
registered-models Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
repos Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
resource-quotas Bump github.com/databricks/databricks-sdk-go from 0.44.0 to 0.45.0 (#1719) 2024-08-27 08:54:05 +00:00
restrict-workspace-admins Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
schemas Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
secrets Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
service-principals Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
serving-endpoints 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
shares 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
system-schemas Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00
table-constraints Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
tables Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
temporary-table-credentials Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
token-management Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
tokens 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
vector-search-endpoints Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
vector-search-indexes Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
volumes Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
warehouses Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
workspace Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
workspace-bindings Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
workspace-conf Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
cmd.go Upgrade to Go SDK 0.47.0 (#1799) 2024-10-01 10:44:47 +00:00
groups.go Upgrade Go SDK to 0.44.0 (#1679) 2024-08-15 13:23:07 +00:00