Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show API choice field metadata more correctly for null vs '' #6197

Merged
merged 1 commit into from
Mar 6, 2020
Merged

Show API choice field metadata more correctly for null vs '' #6197

merged 1 commit into from
Mar 6, 2020

Conversation

jbradberry
Copy link
Contributor

SUMMARY

The verbosity field for WorkflowJobTemplateNodes allows null as an option, but does not support '' getting coerced to null. We need to therefore reflect that in the empty option in the choices list provided by the API.

related #6196

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • API
AWX VERSION
awx: 9.2.0

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@squidboylan
Copy link
Contributor

This works for me! I verified it in the following way:

Navigate to /api/v2/workflow_job_template_nodes/ and click the OPTIONS button and find the POST option verbosity which now has the following options:

            "verbosity": {
                "type": "choice",
                "required": false,
                "label": "Verbosity",
                "filterable": false,
                "default": null,
                "choices": [
                    [
                        null,
                        "---------"
                    ],
                    [
                        0,
                        "0 (Normal)"
                    ],
                    [
                        1,
                        "1 (Verbose)"
                    ],
                    [
                        2,
                        "2 (More Verbose)"
                    ],
                    [
                        3,
                        "3 (Debug)"
                    ],
                    [
                        4,
                        "4 (Connection Debug)"
                    ],
                    [
                        5,
                        "5 (WinRM Debug)"
                    ]
                ]
            },

Then I created a workflow job template node with verbosity=None and confirmed that the API did not send back an error code.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 7a3ece7 into ansible:devel Mar 6, 2020
@jbradberry jbradberry deleted the choice-field-metadata branch June 12, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants