# How to add a documentation fragment of return values?

**URL:** <https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 4, 2022, 4:47pm UTC](https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177 "2022-10-04T16:47:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yorai\_Levi](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yorai\_Levi](https://forum.ansible.com/u/Yorai_Levi)\
**Post date:** [October 4, 2022, 4:47pm UTC](https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177/1 "2022-10-04T16:47:52Z")

</div>

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](https://github.com/ansible-collections/ansible.windows/blob/main/plugins/modules/win_get_url.ps1) works.  
It is backed by a module util, namely WebRequest, which injects its own output into the final output: [WebRequest](https://github.com/ansible-collections/ansible.windows/blob/main/plugins/module_utils/WebRequest.psm1#L467) adding additional values (‘msg’) to the return dictionary without any work from the module itself.

win\_get\_url [hard codes](https://github.com/ansible-collections/ansible.windows/blob/main/plugins/modules/win_get_url.py#L178) 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](https://github.com/ansible/ansible/blob/2cbfd1e350cbe1ca195d33306b5a9628667ddda8/lib/ansible/plugins/doc_fragments/return_common.py#L11) which does exactly what I want? but I see [no usages of it anywhere](https://github.com/ansible/ansible/search?q=return_common)

How to add a documentation fragment of return values?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [October 4, 2022, 6:14pm UTC](https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177/2 "2022-10-04T18:14:37Z")

</div>

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](https://github.com/ansible/ansible/pull/72635)), but it hasn't  
progressed for a long time.

Best,  
Felix

---

<div class="post-metadata">

**Author:** ![Yorai\_Levi](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yorai\_Levi](https://forum.ansible.com/u/Yorai_Levi)\
**Post date:** [October 4, 2022, 6:22pm UTC](https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177/3 "2022-10-04T18:22:38Z")

</div>

Good to know.  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 4, 2022, 7:21pm UTC](https://forum.ansible.com/t/how-to-add-a-documentation-fragment-of-return-values/37177/4 "2022-10-04T19:21:44Z")

</div>

working on it [https://github.com/ansible/ansible/pull/72635](https://github.com/ansible/ansible/pull/72635)
