databricks-cli/libs/flags
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
..
json_flag.go Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
json_flag_test.go Added JSON input validation for CLI commands (#1771) 2024-10-11 14:39:53 +00:00
log_file_flag.go Add structured logging infrastructure (#246) 2023-03-16 14:46:53 +01:00
log_file_flag_test.go Add structured logging infrastructure (#246) 2023-03-16 14:46:53 +01:00
log_level_flag.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
log_level_flag_test.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
output.go Added OpenAPI command coverage (#357) 2023-04-26 13:06:16 +02:00
output_test.go Added OpenAPI command coverage (#357) 2023-04-26 13:06:16 +02:00
progress_format.go Add mode default as a valid set value for progress-format flag (#472) 2023-06-14 13:26:56 +02:00
progress_format_test.go Add progress logs for job runs (#276) 2023-03-29 14:58:09 +02:00
yaml_flag.go Add override to support YAML inputs for apps (#921) 2023-10-27 18:57:26 +00:00