# JSON schema for ansible-doc?

**URL:** <https://forum.ansible.com/t/json-schema-for-ansible-doc/10479>\
**Category:** Get Help\
**Created:** [October 23, 2024, 10:39pm UTC](https://forum.ansible.com/t/json-schema-for-ansible-doc/10479 "2024-10-23T22:39:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HiPhish](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hiphish/32/4901_2.png) [@HiPhish](https://forum.ansible.com/u/HiPhish)\
**Post date:** [October 23, 2024, 10:39pm UTC](https://forum.ansible.com/t/json-schema-for-ansible-doc/10479/1 "2024-10-23T22:39:40Z")

</div>

I have written a Neovim plugin ([ansible-doc.nvim](https://gitlab.com/HiPhish/ansible-doc.nvim)) which lets me browse the documentation of Ansible modules directly from within the editor. It parses the JSON output from `ansible-doc -j` and formats it to something that’s pleasant to the eye.

My question is whether there is an official JSON schema or some other specification. For now I have picked a select few documents, looked at their structure and come up with some ad-hoc renderer. However, every now and then I come across a document which does not match my assumptions. Without a proper definition the best I can do is trial and error over and over again, which is something I want to avoid.

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 24, 2024, 3:27pm UTC](https://forum.ansible.com/t/json-schema-for-ansible-doc/10479/2 "2024-10-24T15:27:30Z")

</div>

While there is a minimal expected schema for ansible-doc, it does not strictly enforce one and allows for user fields. For example if a company needs to add ‘Authorized\_for: groupname’ to plugins, they can and we will present it and ignore it.

The validations/tests to include in core or certified collections do a strict validation and that schema is implemented in the validate-modules subsystem of ansible-test, specifically in [ansible/test/lib/ansible\_test/\_util/controller/sanity/validate-modules/validate\_modules/schema.py at devel · ansible/ansible · GitHub](https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py)
