-
Notifications
You must be signed in to change notification settings - Fork 0
[test] Add test cases for types and combinations in values.yaml #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../test.mk |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ## Case Description | ||
|
|
||
| Test cases for basic types: | ||
|
|
||
| - `int` | ||
| - `bool` | ||
| - `string` | ||
|
|
||
| All types are checked in required and nullable variations. | ||
|
|
||
| ## Parameters | ||
| ### Integer parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------------------------ | --------------------------------------------- | ------ | ------ | | ||
| | `testInt` | Integer variable | `int` | `0` | | ||
| | `testIntDefault` | Integer variable with default value | `int` | `10` | | ||
| | `testIntNullable` | Integer variable, nullable | `*int` | `null` | | ||
| | `testIntDefaultNullable` | Integer variable with default value, nullable | `*int` | `10` | | ||
|
|
||
|
|
||
| ### Boolean parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ----------------------- | --------------------------------------------- | ------- | ------- | | ||
| | `testBool` | Boolean variable | `bool` | `false` | | ||
| | `testBoolFalse` | Boolean variable, defaults to false | `bool` | `false` | | ||
| | `testBoolTrue` | Boolean variable, defaults to true | `bool` | `true` | | ||
| | `testBoolNullable` | Boolean variable, nullable | `*bool` | `null` | | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. must be false
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct behavior, because if type is nullabe it can be unset, we should not provide any empty values for it |
||
| | `testBoolFalseNullable` | Boolean variable, defaults to false, nullable | `*bool` | `false` | | ||
| | `testBoolTrueNullable` | Boolean variable, defaults to true, nullable | `*bool` | `true` | | ||
|
|
||
|
|
||
| ### String parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | --------------------------- | -------------------------------------------- | --------- | -------------- | | ||
| | `testString` | String variable | `string` | `""` | | ||
| | `testStringEmpty` | String variable, empty by default | `string` | `""` | | ||
| | `testStringDefault` | String variable with default value | `string` | `string value` | | ||
| | `testStringNullable` | String variable, nullable | `*string` | `null` | | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. must be empty string
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct behavior, because if type is nullabe it can be unset, we should not provide any empty values for it |
||
| | `testStringEmptyNullable` | String variable, empty by default, nullable | `*string` | `""` | | ||
| | `testStringDefaultNullable` | String variable with default value, nullable | `*string` | `string value` | | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,78 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "title": "Chart Values", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add Explicitly declaring the draft your schema adheres to avoids tooling ambiguities and validation surprises. {
+ "$schema": "https://json-schema.org/draft-07/schema#",
"title": "Chart Values",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBool": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBoolFalse": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable, defaults to false", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBoolFalseNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable, defaults to false, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBoolNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The schema for |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBoolTrue": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable, defaults to true", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testBoolTrueNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Boolean variable, defaults to true, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testInt": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Integer variable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testIntDefault": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Integer variable with default value", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "integer", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testIntDefaultNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Integer variable with default value, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "integer", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testIntNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Integer variable, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testString": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testStringDefault": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable with default value", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "string value" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testStringDefaultNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable with default value, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "string value" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testStringEmpty": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable, empty by default", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testStringEmptyNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable, empty by default, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "testStringNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "String variable, nullable", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. “Nullable” properties do not actually accept Every property whose name includes “Nullable” is still restricted to a single primitive type. Example fix for one property (apply the same pattern to the others): "testBoolFalseNullable": {
"description": "Boolean variable, defaults to false, nullable",
- "type": "boolean",
+ "type": ["boolean", "null"],
"default": false
},Without this change, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NickVolynkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| ## @section Integer parameters | ||
|
|
||
| ## @param testInt {int} Integer variable | ||
| testInt: | ||
| ## @param testIntDefault {int} Integer variable with default value | ||
| testIntDefault: 10 | ||
| ## @param testIntNullable {*int} Integer variable, nullable | ||
| testIntNullable: | ||
| ## @param testIntDefaultNullable {*int} Integer variable with default value, nullable | ||
| testIntDefaultNullable: 10 | ||
|
|
||
| ## @section Boolean parameters | ||
|
|
||
| ## @param testBool {bool} Boolean variable | ||
| testBool: | ||
| ## @param testBoolFalse {bool} Boolean variable, defaults to false | ||
| testBoolFalse: false | ||
| ## @param testBoolTrue {bool} Boolean variable, defaults to true | ||
| testBoolTrue: true | ||
| ## @param testBoolNullable {*bool} Boolean variable, nullable | ||
| testBoolNullable: | ||
| ## @param testBoolFalseNullable {*bool} Boolean variable, defaults to false, nullable | ||
| testBoolFalseNullable: false | ||
| ## @param testBoolTrueNullable {*bool} Boolean variable, defaults to true, nullable | ||
| testBoolTrueNullable: true | ||
|
|
||
| ## @section String parameters | ||
|
|
||
| ## @param testString {string} String variable | ||
| testString: | ||
| ## @param testStringEmpty {string} String variable, empty by default | ||
| testStringEmpty: "" | ||
| ## @param testStringDefault {string} String variable with default value | ||
| testStringDefault: "string value" | ||
| ## @param testStringNullable {*string} String variable, nullable | ||
| testStringNullable: | ||
| ## @param testStringEmptyNullable {*string} String variable, empty by default, nullable | ||
| testStringEmptyNullable: "" | ||
| ## @param testStringDefaultNullable {*string} String variable with default value, nullable | ||
| testStringDefaultNullable: "string value" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../test.mk |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| ## Case Description | ||
|
|
||
| Tests for complex types, extending base ones. | ||
|
|
||
| - `quantity` — measure of CPU cores and memory. | ||
|
|
||
| ## Parameters | ||
| ### Quantity parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ------------------------- | --------------------------------------------------------------- | -------- | -------- | | ||
| | `quantityRequired` | A required quantity value (CPU cores or RAM). | `string` | `""` | | ||
| | `quantityRequiredEmpty` | A required quantity value with empty string (CPU cores or RAM). | `string` | `""` | | ||
| | `quantityDefaultInt` | A quantity default with a bare integer. | `string` | `2` | | ||
| | `quantityDefaultStrInt` | A quantity default with a quoted integer. | `string` | `2` | | ||
| | `quantityDefaultCpuShare` | A quantity default with vCPU share. | `string` | `100m` | | ||
| | `quantityDefaultRam` | A quantity default with RAM size. | `string` | `500MiB` | | ||
|
|
||
|
|
||
| ### Nullable quantity parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | --------------------------------- | --------------------------------------------------------------- | --------- | -------- | | ||
| | `quantityNullable` | A nullable quantity value. | `*string` | `null` | | ||
| | `quantityNullableRequiredEmpty` | A nullable quantity value with empty string (CPU cores or RAM). | `*string` | `""` | | ||
| | `quantityNullableDefaultInt` | A nullable quantity with a default bare integer. | `*string` | `2` | | ||
| | `quantityNullableDefaultStrInt` | A nullable quantity with a default quoted integer. | `*string` | `2` | | ||
| | `quantityNullableDefaultCpuShare` | A nullable quantity with a default CPU share. | `*string` | `100m` | | ||
| | `quantityNullableDefaultRam` | A nullable quantity with a default RAM size. | `*string` | `500MiB` | | ||
|
|
||
|
|
||
| ### Enumerated parameters | ||
|
|
||
| | Name | Description | Type | Value | | ||
| | ---------------------------------- | ------------------------------------ | -------- | ------- | | ||
| | `enumWithDefault` | Enum variable, defaults to "micro" | `string` | `{}` | | ||
| | `enumWithoutDefault` | Enum variable with no default value. | `string` | `{}` | | ||
| | `nested` | Element with nested enum fields | `object` | `{}` | | ||
| | `nested.enumWithCustomTypeDefault` | Enum variable, defaults to "micro" | `string` | `micro` | | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "title": "Chart Values", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "properties": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "enumWithDefault": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Enum variable, defaults to \"micro\"", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "micro", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "enum": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "nano", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "micro", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "small", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "medium", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "large", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "xlarge", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "2xlarge" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "enumWithoutDefault": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Enum variable with no default value.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "enum": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "nano", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "micro", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "small", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "medium", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "large", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "xlarge", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "2xlarge" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "nested": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Element with nested enum fields", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "object", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "enumWithCustomTypeDefault": "micro" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityDefaultCpuShare": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A quantity default with vCPU share.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "100m", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityDefaultInt": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A quantity default with a bare integer.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityDefaultRam": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A quantity default with RAM size.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "500MiB", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityDefaultStrInt": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A quantity default with a quoted integer.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullable": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity value.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+67
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The schema for
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kvaps is this how nullable types are declared for K8s API? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullableDefaultCpuShare": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity with a default CPU share.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "100m", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullableDefaultInt": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity with a default bare integer.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullableDefaultRam": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity with a default RAM size.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "500MiB", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullableDefaultStrInt": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity with a default quoted integer.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "default": "2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityNullableRequiredEmpty": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A nullable quantity value with empty string (CPU cores or RAM).", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+101
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The description says “with empty string”, but the regex disallows an empty value, so If an empty string is legitimate, make the pattern optional: -"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
+"pattern": "^$|^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityRequired": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A required quantity value (CPU cores or RAM).", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantityRequiredEmpty": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "A required quantity value with empty string (CPU cores or RAM).", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "type": "string", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "x-kubernetes-int-or-string": true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+107
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveProperties labelled “Required” are not actually required Neither Add an explicit required list: {
"title": "Chart Values",
"type": "object",
+ "required": ["quantityRequired", "quantityRequiredEmpty"],
"properties": {Add explicit required properties to JSON schema The fields named “quantityRequired” and “quantityRequiredEmpty” aren’t enforced as required because they’re missing from the schema’s top-level • File: test/complex-types/values.schema.json "title": "Chart Values",
"type": "object",
+ "required": ["quantityRequired", "quantityRequiredEmpty"],
"properties": {
"quantityRequired": {
"description": "A required quantity value (CPU cores or RAM).",
"type": "string",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"x-kubernetes-int-or-string": true
},
"quantityRequiredEmpty": {
"description": "A required quantity value with empty string (CPU cores or RAM).",
"type": "string",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"x-kubernetes-int-or-string": true
}This ensures both properties are truly required by the schema. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct behavior, because if type is nullabe it can be unset, we should not provide any empty values for it