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

arm-ttk applies "CreateUIDefinition Must Not Have Blanks" test to user data #772

Open
raouche opened this issue Mar 2, 2024 · 0 comments

Comments

@raouche
Copy link
Contributor

raouche commented Mar 2, 2024

arm-ttk version: 0.24
Scenario: You have a DropDown control where the value of each "allowedValue" constraint is a JSON object that is domain-specific (see the sample CUID below that applies to the birds domain). Note that the JSON payload is user data, not CUID properties.

Problem: When running arm-ttk against this example, the following error is returned, indicating that arm-ttk is applying the "CreateUIDefinition Must Not Have Blanks" test case not only to CUID base constructs but also to user data:

CreateUIDefinition Must Not Have Blanks
  - Error: Empty property: synonyms found on line: 15

NOTE: While one can argue that perhaps the JSON payloads of the user data should remove the empty properties, there are many cases, especially with generated data, where removing the empty property is not an option and adds a certain maintenance overhead.

Sample CUID:

{
  "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
  "handler": "Microsoft.Azure.CreateUIDef",
  "version": "0.1.2-preview",
  "parameters": {
    "basics": [
      {
        "constraints": {
          "allowedValues": [
            {
              "label": "Pelican",
              "value": {
                "family": "Palecanidae",
                "genus": "Pelecanus",
                "synonyms": ""
              }
            },
            {
              "label": "Heron",
              "value": {
                "family": "Ardeidae",
                "genus": "Ardea",
                "synonyms": "Cochlearidae"
              }
            }
          ]
        },
        "label": "DropDown1",
        "name": "DropDown1",
        "toolTip": "DropDown1",
        "type": "Microsoft.Common.DropDown"
      }
    ],
    "steps": [],
    "outputs": {
      "location": "[location()]",
      "DropDown1": "[basics('DropDown1')]"
    }
  },
  "metadata": {
    "_generator": {
      "name": "MaestroStudio",
      "sku": "Solo",
      "version": "0.9.0.0",
      "template": {
        "author": "StratusOn",
        "id": "EA622966-CE0C-46E7-841B-73C2E6ED5DEB",
        "description": "A blank Azure Marketplace Managed Application offer."
      }
    },
    "_sync": {
      "offer": {
        "displayName": "My Offer"
      },
      "plan": {
        "displayName": "Plan"
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant