Skip to content

Commit aec3fa2

Browse files
committed
fix: Supply the default value for Argument#arity if the field is omitted
1 parent 843db4b commit aec3fa2

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

draft.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This document is licensed under the MIT license
1313

1414
| Date | Author | Description |
1515
|------|--------|-------------|
16+
| 2026-03-24 | Bob Lail | Add default value for `arity` to `[Argument Object](#argument-object) |
1617
| 2025-07-15 | Patrik Svensson | Added `interactive` to root command and commands |
1718
| 2025-07-16 | Patrik Svensson | Added [Metadata Object](#metadata-object) |
1819
| 2025-07-16 | Patrik Svensson | Changed maps to arrays |

schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@
129129
},
130130
"arity": {
131131
"$ref": "#/$defs/Arity",
132+
"default": {
133+
"minimum": 1,
134+
"maximum": 1
135+
},
132136
"description": "The argument arity. Arity defines the minimum and maximum number of argument values"
133137
},
134138
"acceptedValues": {

typespec/main.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ model Argument {
132132
required?: boolean = false;
133133

134134
@doc("The argument arity. Arity defines the minimum and maximum number of argument values")
135-
arity?: Arity;
135+
arity?: Arity = #{ minimum: 1, maximum: 1 };
136136

137137
@doc("A list of accepted values")
138138
acceptedValues?: string[];

0 commit comments

Comments
 (0)