From a26df3135b73290951c45a2a3903849517a44c72 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Fri, 3 Apr 2020 13:12:49 -0400 Subject: [PATCH] static identifier in docs * OPTIONS response descritpion for workflow job template node identifier value was an ever changing uuid4(). This is telling the user the wrong thing. We can not know what uuid4() is going to be in the docs. Instead, for the OPTIONS response description, tell the user the form that the uuid4() takes, ie. xxx-xxxx... * Note that the API browser still populates a uuid4 for the user when it generates the sample POST data. This is nice. --- awx/api/metadata.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/api/metadata.py b/awx/api/metadata.py index 064fcd27a4..8bbfb906ef 100644 --- a/awx/api/metadata.py +++ b/awx/api/metadata.py @@ -2,6 +2,7 @@ # All Rights Reserved. from collections import OrderedDict +from uuid import UUID # Django from django.core.exceptions import PermissionDenied @@ -86,6 +87,8 @@ class Metadata(metadata.SimpleMetadata): # FIXME: Still isn't showing all default values? try: default = field.get_default() + if type(default) is UUID: + default = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' if field.field_name == 'TOWER_URL_BASE' and default == 'https://towerhost': default = '{}://{}'.format(self.request.scheme, self.request.get_host()) field_info['default'] = default