databricks-cli/cmd
Andrew Nester 17ed7a317b
Fixed ignoring required positional parameters when --json flag is provided (#535)
## Changes
When there are positional required parameters in the command which can't
be unmarshalled from JSON, we should require them despite the fact
`--json` flag is provided.

The reason is that for some of the command, for example, `databricks
groups patch ID` these arguments are actually path arguments in API and
can't be set as part of `--json` body provided.

Original change which introduced this ignore logic is here:
https://github.com/databricks/cli/pull/405

Fixes https://github.com/databricks/cli/issues/533,
https://github.com/databricks/cli/issues/537

Note: Code generation is based on the change in this PR:
https://github.com/databricks/databricks-sdk-go/pull/536

## Tests
1. Running `cli groups patch 123 --json {...}` works correctly

Backward compatibility tests with previous changes from
https://github.com/databricks/cli/pull/405
1. `cli clusters events --json '{"cluster_id": "1029-xxxx"}'` - works,
returns list of events
2. `cli clusters events 1029-xxxx` - works, returns list of events
3. `cli clusters events` - works, first prompts for Cluster ID and then
returns the list of events
2023-07-03 13:20:30 +02:00
..
account Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00
api Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
auth Bump Go SDK to v0.12.0 (#540) 2023-07-03 11:46:45 +02:00
bundle Application -> Asset (#529) 2023-06-27 01:31:20 +02:00
configure Update configure command (#482) 2023-06-15 12:50:19 +00:00
fs Add --absolute flag for ls command (#508) 2023-06-27 16:06:56 +02:00
root Do not use white color as string output (#489) 2023-06-16 13:55:22 +00:00
sync Remove \r from new line print statments (#509) 2023-06-22 13:47:52 +02:00
version Use cmdio in version command for `--output` flag (#419) 2023-06-01 12:03:22 +02:00
workspace Fixed ignoring required positional parameters when --json flag is provided (#535) 2023-07-03 13:20:30 +02:00