From d962611528169bdbeb184814c432f827fd43f23d Mon Sep 17 00:00:00 2001 From: John R Barker Date: Thu, 5 Jul 2018 06:57:58 -0700 Subject: [PATCH] Allow documentation of module options type (#42285) * Allow documentation of module options Pass through the `type` of a modules option so it's displayed on the html module docs * docs --- docs/docsite/rst/dev_guide/developing_modules_documenting.rst | 4 +++- test/sanity/validate-modules/schema.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst index 5d497ae2159..73c9d9b1abb 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_documenting.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_documenting.rst @@ -239,7 +239,9 @@ The following fields can be used and are all required unless specified otherwise :choices: List of option values. Should be absent if empty. :type: - If an argument is ``type='bool'``, this field should be set to ``type: bool`` and no ``choices`` should be specified. + + * Specifies the data type that option accepts, must match the ``argspec``. + * If an argument is ``type='bool'``, this field should be set to ``type: bool`` and no ``choices`` should be specified. :aliases: List of option name aliases; generally not needed. :version_added: diff --git a/test/sanity/validate-modules/schema.py b/test/sanity/validate-modules/schema.py index 618dbb95c5b..41e3342a960 100644 --- a/test/sanity/validate-modules/schema.py +++ b/test/sanity/validate-modules/schema.py @@ -50,7 +50,7 @@ option_schema = Schema( 'default': Any(None, float, int, bool, list, dict, *string_types), 'suboptions': Any(None, *list_dict_suboption_schema), # Note: Types are strings, not literal bools, such as True or False - 'type': Any(None, "bool") + 'type': Any(None, 'str', 'list', 'dict', 'bool', 'int', 'float', 'path', 'raw', 'jsonarg', 'json', 'bytes', 'bits') }, extra=PREVENT_EXTRA )