databricks-cli/libs/jsonschema
shreyas-goenka f2408eda62
Add support for reprompts if user input does not match template schema (#946)
## Changes
This PR adds retry logic to user input prompts, prompting users again if
the value does not match the requirements specified in the bundle
template schema.

## Tests
Manually. Here's an example UX. The first prompt expects an integer and
the second one a string made only from the letters "defg"

```
shreyas.goenka@THW32HFW6T cli % cli bundle init ~/mlops-stack

Please enter an integer [123]: abc
Validation failed: "abc" is not a integer

Please enter an integer [123]: 123

Please enter a string [dddd]: apple
Validation failed: invalid value for input_root_dir: "apple". Only characters the 'd', 'e', 'f', 'g' are allowed
```
2023-12-22 15:43:08 +00:00
..
testdata Add support for conditional prompting in bundle init (#971) 2023-11-30 16:07:45 +00:00
extension.go Add support for conditional prompting in bundle init (#971) 2023-11-30 16:07:45 +00:00
instance.go Make to/from string methods private to the jsonschema package (#942) 2023-11-06 15:05:17 +00:00
instance_test.go Fix pattern validation for input properties (#912) 2023-10-24 15:56:54 +00:00
schema.go Add support for conditional prompting in bundle init (#971) 2023-11-30 16:07:45 +00:00
schema_order.go Add support for ordering of input prompts (#662) 2023-09-05 11:08:25 +00:00
schema_order_test.go Add support for ordering of input prompts (#662) 2023-09-05 11:08:25 +00:00
schema_test.go Add support for conditional prompting in bundle init (#971) 2023-11-30 16:07:45 +00:00
utils.go Add support for reprompts if user input does not match template schema (#946) 2023-12-22 15:43:08 +00:00
utils_test.go Add support for reprompts if user input does not match template schema (#946) 2023-12-22 15:43:08 +00:00
validate_type.go Add schema and config validation to jsonschema package (#740) 2023-09-07 14:36:06 +00:00
validate_type_test.go Add schema and config validation to jsonschema package (#740) 2023-09-07 14:36:06 +00:00