From 37ca3a821dab0ff8f69c416864894db75ee0351f Mon Sep 17 00:00:00 2001 From: Marek Kulik Date: Wed, 9 Oct 2024 23:06:53 +0200 Subject: [PATCH] Add support for optional parameters --- functions/Cursor/showCursor.yaml | 1 + schemas/function.yaml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/functions/Cursor/showCursor.yaml b/functions/Cursor/showCursor.yaml index 07f1447..7e860da 100644 --- a/functions/Cursor/showCursor.yaml +++ b/functions/Cursor/showCursor.yaml @@ -16,6 +16,7 @@ shared: &shared type: 'bool' description: | A boolean value determining whether to disable controls whilst the cursor is showing. *true* implies controls are disabled, *false* implies controls remain enabled. + default: 'true' returns: description: | Returns *true* if the player's cursor was shown or hidden successfully, *false* otherwise. diff --git a/schemas/function.yaml b/schemas/function.yaml index d9477b2..42dd72c 100644 --- a/schemas/function.yaml +++ b/schemas/function.yaml @@ -100,6 +100,15 @@ $defs: description: type: string description: Describe the usage, contraints and other useful information about the parameter. + default: + type: string + description: | + The default value for this parameter, if none was given in the call to the function. + This property automatically implicitly marks this parameter as optional. + optional: + type: boolean + default: false + description: If set to true, this parameter will be marked as optional. returns: type: object