This website requires JavaScript.
Explore
Help
Sign In
steve
/
databricks-cli
mirror of
https://github.com/databricks/cli.git
Watch
1
Star
0
Fork
You've already forked databricks-cli
0
Code
Issues
Packages
Projects
Releases
Wiki
Activity
d9a276b17d
databricks-cli
/
libs
/
jsonschema
/
testdata
/
schema-load-int
/
schema-valid.json
11 lines
164 B
JSON
Raw
Normal View
History
Unescape
Escape
Add schema and config validation to jsonschema package (#740) ## Changes At a high level this PR adds new schema validation and moves functionality that should be present in the jsonschema package, but resides in the template package today, to the jsonschema package. This includes for example schema validation, schema instance validation, to / from string conversion methods etc. The list below outlines all the pieces that have been moved over, and the new validation bits added. This PR: 1. Adds casting default value of schema properties to integers to the jsonschema.Load method. 2. Adds validation for default value types for schema properties, checking they are consistant with the type defined. 3. Introduces the LoadInstance and ValidateInstance methods to the json schema package. These methods can be used to read and validate JSON documents against the schema. 4. Replaces validation done for template inputs to use the newly defined JSON schema validation functions. 5. Moves to/from string and isInteger utility methods to the json schema package. ## Tests Existing and new unit tests.
2023-09-07 14:36:06 +00:00
{
"type"
:
"object"
,
"properties"
:
{
"abc"
:
{
"type"
:
"integer"
,
Add enum support for bundle templates (#668) ## Changes This PR includes: 1. Adding enum field to the json schema struct 2. Adding prompting logic for enum values. See demo for how it looks 3. Validation rules, validating the default value and config values when an enum list is specified This will now enable template authors to use enums for input parameters. ## Tests Manually and new unit tests
2023-09-08 12:07:22 +00:00
"default"
:
1
,
"enum"
:
[
1
,
2
,
3
]
Add schema and config validation to jsonschema package (#740) ## Changes At a high level this PR adds new schema validation and moves functionality that should be present in the jsonschema package, but resides in the template package today, to the jsonschema package. This includes for example schema validation, schema instance validation, to / from string conversion methods etc. The list below outlines all the pieces that have been moved over, and the new validation bits added. This PR: 1. Adds casting default value of schema properties to integers to the jsonschema.Load method. 2. Adds validation for default value types for schema properties, checking they are consistant with the type defined. 3. Introduces the LoadInstance and ValidateInstance methods to the json schema package. These methods can be used to read and validate JSON documents against the schema. 4. Replaces validation done for template inputs to use the newly defined JSON schema validation functions. 5. Moves to/from string and isInteger utility methods to the json schema package. ## Tests Existing and new unit tests.
2023-09-07 14:36:06 +00:00
}
}
}