diff --git a/draft.md b/draft.md index 8c41064..256331d 100644 --- a/draft.md +++ b/draft.md @@ -13,6 +13,7 @@ This document is licensed under the MIT license | Date | Author | Description | |------|--------|-------------| +| 2026-03-24 | Bob Lail | Add default value for `arity` to [Argument Object](#argument-object) | | 2025-07-15 | Patrik Svensson | Added `interactive` to root command and commands | | 2025-07-16 | Patrik Svensson | Added [Metadata Object](#metadata-object) | | 2025-07-16 | Patrik Svensson | Changed maps to arrays | @@ -167,7 +168,7 @@ This is the root object of the OpenCLI Description. |------------|:----:|---------------|-------------| | name | `string` | - | **REQUIRED** The argument name | | required | `bool` | `false` | Whether or not the argument is required | -| arity | [Arity Object](#arity-object) | - | The argument arity. Arity defines the minimum and maximum number of argument values | +| arity | [Arity Object](#arity-object) | `{"minimum": 1, "maximum": 1}` | The argument arity. Arity defines the minimum and maximum number of argument values | | acceptedValues | [`string`] | - | A list of accepted values | | group | `string` | - | The argument group | | description | `string` | - | The argument description | diff --git a/schema.json b/schema.json index f641e0b..c6b476b 100644 --- a/schema.json +++ b/schema.json @@ -129,6 +129,10 @@ }, "arity": { "$ref": "#/$defs/Arity", + "default": { + "minimum": 1, + "maximum": 1 + }, "description": "The argument arity. Arity defines the minimum and maximum number of argument values" }, "acceptedValues": { diff --git a/typespec/main.tsp b/typespec/main.tsp index a3e3f1b..2744ce8 100644 --- a/typespec/main.tsp +++ b/typespec/main.tsp @@ -132,7 +132,7 @@ model Argument { required?: boolean = false; @doc("The argument arity. Arity defines the minimum and maximum number of argument values") - arity?: Arity; + arity?: Arity = #{ minimum: 1, maximum: 1 }; @doc("A list of accepted values") acceptedValues?: string[];