Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/virtual-machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
external: false
externalMethod: PortList
externalPorts:
- 22
- 22

## @param running {bool} if the virtual machine should be running
running: true
Expand Down
1 change: 1 addition & 0 deletions test/basic-types/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../test.mk
45 changes: 45 additions & 0 deletions test/basic-types/README.md
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` |
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be 0

Copy link
Member

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

| `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` |
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be false

Copy link
Member

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

| `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` |
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be empty string

Copy link
Member

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

| `testStringEmptyNullable` | String variable, empty by default, nullable | `*string` | `""` |
| `testStringDefaultNullable` | String variable with default value, nullable | `*string` | `string value` |


78 changes: 78 additions & 0 deletions test/basic-types/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"title": "Chart Values",
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add $schema meta-key for explicit draft version

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"title": "Chart Values",
{
"$schema": "https://json-schema.org/draft-07/schema#",
"title": "Chart Values",
🤖 Prompt for AI Agents
In test/basic-types/values.schema.json at the beginning of the file (lines 1-2),
add the "$schema" key with the appropriate JSON Schema draft URL to explicitly
declare the schema version. This will ensure tools correctly interpret and
validate the schema according to the specified draft version.

"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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The schema for testBoolNullable should allow null values, as indicated by the *bool type in values.yaml. The current schema only allows a boolean, which would cause validation to fail for null values. This issue applies to all nullable types in this file. Since these test files are intended to lock in the behavior of cozyvalues-gen, it seems the tool has a bug in generating schemas for nullable types.

    "testBoolNullable": {
      "description": "Boolean variable, nullable",
      "type": ["boolean", "null"]
    },

"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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

“Nullable” properties do not actually accept null

Every property whose name includes “Nullable” is still restricted to a single primitive type.
If the intention is to allow null, the type field must be an array that includes "null" (draft-07) or use anyOf.

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, null will be rejected by schema validators, defeating the test’s purpose.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"testBoolFalseNullable": {
"description": "Boolean variable, defaults to false, nullable",
"type": "boolean",
"default": false
},
"testBoolNullable": {
"description": "Boolean variable, nullable",
"type": "boolean"
},
"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"
}
"testBoolFalseNullable": {
"description": "Boolean variable, defaults to false, nullable",
"type": ["boolean", "null"],
"default": false
},
🤖 Prompt for AI Agents
In test/basic-types/values.schema.json from lines 14 to 76, properties labeled
as "Nullable" do not currently accept null values because their "type" fields
specify only a single primitive type. To fix this, update each "Nullable"
property's "type" field to be an array including the original type and "null"
(e.g., "type": ["boolean", "null"]) or use "anyOf" with the original type and a
null type schema. This change will allow these properties to accept null values
as intended.

}
}
40 changes: 40 additions & 0 deletions test/basic-types/values.yaml
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"
1 change: 1 addition & 0 deletions test/complex-types/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../test.mk
41 changes: 41 additions & 0 deletions test/complex-types/README.md
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` |


120 changes: 120 additions & 0 deletions test/complex-types/values.schema.json
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The schema for quantityNullable should allow null values, as indicated by the *quantity type in values.yaml. The current schema only allows a string, which would cause validation to fail for null values. This issue applies to all nullable types in this file.

    "quantityNullable": {
      "description": "A nullable quantity value.",
      "type": ["string", "null"],
      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
      "x-kubernetes-int-or-string": true
    },

Copy link
Author

Choose a reason for hiding this comment

The 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

quantityNullableRequiredEmpty cannot be empty due to the regex

The description says “with empty string”, but the regex disallows an empty value, so "" will fail validation.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"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
},
"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
},
🤖 Prompt for AI Agents
In test/complex-types/values.schema.json around lines 67 to 72, the pattern
regex for "quantityNullableRequiredEmpty" does not allow an empty string,
conflicting with the description that says it can be empty. To fix this, modify
the regex pattern to make the entire pattern optional, allowing an empty string
to pass validation while preserving the existing numeric format matching.

"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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Properties labelled “Required” are not actually required

Neither quantityRequired nor quantityRequiredEmpty are listed in a top-level "required": [...] array, so they remain optional.

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 required array. Please update test/complex-types/values.schema.json accordingly:

• File: test/complex-types/values.schema.json
• Location: directly after the top-level "type": "object", entry

   "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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"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
}
"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
}
}
🤖 Prompt for AI Agents
In test/complex-types/values.schema.json around lines 73 to 84, the properties
"quantityRequired" and "quantityRequiredEmpty" are defined but not enforced as
required. To fix this, add both property names to the schema's top-level
"required" array, which is located directly after the "type": "object"
declaration. This change will ensure these fields are mandatory according to the
JSON schema.

}
}
Loading