How to add a documentation fragment of return values?

20 views
Skip to first unread message

Yorai Levi

unread,
Oct 4, 2022, 12:47:52 PM10/4/22
to Ansible Project
Hi,
I am trying to understand how to document, specifically documentation fragments.
following the examples from the documentation everything works, I am able to insert fragments that merge into `DOCUMENTATION`

But I came into trouble with inserting return type fragments.
I have been trying to follow the way win_get_url  works.
It is backed by a module util, namely WebRequest, which injects its own output into the final output: WebRequest adding additional values ('msg') to the return dictionary without any work from the module itself.

win_get_url hard codes these additional return values into its documentation. I do not see any deliberate usage of this value in win_get_url's code. I expected this kind of behavior to be backed by a `RETURN` documentation fragment but it is not.


I have also searched and found return_common.py which does exactly what I want? but I see no usages of it anywhere

How to add a documentation fragment of return values? 


Felix Fontein

unread,
Oct 4, 2022, 2:14:58 PM10/4/22
to ansible...@googlegroups.com
Hi,

> I am trying to understand how to document, specifically documentation
> fragments.
> following the examples from the documentation everything works, I am
> able to insert fragments that merge into `DOCUMENTATION`

that is correct.

> But I came into trouble with inserting return type fragments.

That is not surprising, since that's not possible yet (unfortunately!).

There exists a WIP PR to allow this eventually
(https://github.com/ansible/ansible/pull/72635), but it hasn't
progressed for a long time.

Best,
Felix


Yorai Levi

unread,
Oct 4, 2022, 2:22:38 PM10/4/22
to Ansible Project
Good to know.
Thanks

Brian Coca

unread,
Oct 4, 2022, 3:23:22 PM10/4/22
to ansible...@googlegroups.com
working on it https://github.com/ansible/ansible/pull/72635


--
----------
Brian Coca

Reply all
Reply to author
Forward
0 new messages