[Solved] In the documentation, optional function parameters have been marked as mandatory

For example, API reference (GUI) used to be shown as gui.animate(node, property, to, easing, duration, [delay], [complete_function], [playback]), but now it appears as gui.animate(node, property, to, easing, duration, delay, complete_function, playback).

Apparently, this caused issues with the “Defold Kit” annotations, as the “|nil” option for function parameters has disappeared.


If you look at an old ref-doc.zip you’ll see the following:

(from Release v1.8.1 - stable · defold/defold · GitHub)

        {
          "name": "[position]",
          "doc": "position to assign to the newly spawned collection",
          "types": [
            "vector3"
          ]
        },

In new versions of the ref-doc.zip parameters are properly tagged as optional, but the variable name is no longer enclosed in square brackets:

(from Release v1.10.2 - stable · defold/defold · GitHub)

        {
          "name": "position",
          "doc": "position to assign to the newly spawned collection",
          "types": [
            "vector3"
          ],
          "is_optional": "True"
        },

There’s two problems:

  1. The author of Defold Kit (@astrochili) need to change so that it is not the variable name but the is_optional field that is used
  2. The API reference on the homepage needs to be updated to show the square brackets to indicate that a parameter is optional (I’ll fix that asap)
3 Likes

Thank you for noticing.
Fixed! Just fetch the annotations again.

4 Likes