From 45264c2009c4ff5bfb704b8df9f925c779feafe1 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Wed, 15 Jun 2016 17:27:16 -0400 Subject: [PATCH] Hide write-only fields from results in API docs. --- awx/api/templates/api/_result_fields_common.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/api/templates/api/_result_fields_common.md b/awx/api/templates/api/_result_fields_common.md index 43abefc534..e2a408d7c6 100644 --- a/awx/api/templates/api/_result_fields_common.md +++ b/awx/api/templates/api/_result_fields_common.md @@ -1,5 +1,6 @@ {% for fn, fm in serializer_fields.items %}{% spaceless %} -{% if not write_only or not fm.read_only %} +{% if write_only and fm.read_only or not write_only and fm.write_only %} +{% else %} * `{{ fn }}`: {{ fm.help_text|capfirst }} ({{ fm.type }}{% if write_only and fm.required %}, required{% endif %}{% if write_only and fm.read_only %}, read-only{% endif %}{% if write_only and not fm.choices and not fm.required %}, default=`{% if fm.type == "string" or fm.type == "email" %}"{% firstof fm.default "" %}"{% else %}{% if fm.type == "field" and not fm.default %}None{% else %}{{ fm.default }}{% endif %}{% endif %}`{% endif %}){% if fm.choices %}{% for c in fm.choices %} - `{% if c.0 == "" %}""{% else %}{{ c.0 }}{% endif %}`{% if c.1 != c.0 %}: {{ c.1 }}{% endif %}{% if write_only and c.0 == fm.default %} (default){% endif %}{% endfor %}{% endif %}{% endif %} {% endspaceless %}