Skip to content

Commit 15192ca

Browse files
authored
schema: strict additionalProperties and typed value in issue_fields items
1 parent d63407c commit 15192ca

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

pkg/github/__toolsnaps__/issue_write.snap

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"issue_fields": {
3333
"description": "Issue field values to set. Each item requires 'field_name' and exactly one of 'value' or 'field_option_name'.",
3434
"items": {
35+
"additionalProperties": false,
3536
"oneOf": [
3637
{
3738
"not": {
@@ -64,7 +65,12 @@
6465
"type": "string"
6566
},
6667
"value": {
67-
"description": "Value to set. For single-select fields, prefer 'field_option_name' to validate the option exists first."
68+
"description": "Value to set. For single-select fields, prefer 'field_option_name' to validate the option exists first.",
69+
"type": [
70+
"string",
71+
"number",
72+
"boolean"
73+
]
6874
}
6975
},
7076
"required": [

pkg/github/issues.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,13 +1721,15 @@ Options are:
17211721
Type: "array",
17221722
Description: "Issue field values to set. Each item requires 'field_name' and exactly one of 'value' or 'field_option_name'.",
17231723
Items: &jsonschema.Schema{
1724-
Type: "object",
1724+
Type: "object",
1725+
AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}},
17251726
Properties: map[string]*jsonschema.Schema{
17261727
"field_name": {
17271728
Type: "string",
17281729
Description: "Issue field name",
17291730
},
17301731
"value": {
1732+
Types: []string{"string", "number", "boolean"},
17311733
Description: "Value to set. For single-select fields, prefer 'field_option_name' to validate the option exists first.",
17321734
},
17331735
"field_option_name": {

0 commit comments

Comments
 (0)