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

[BUG] Microsoft.AzureActiveDirectory/ciamDirectories: The location enum is empty in JSON schema #31536

Open
StephenWeatherford opened this issue Nov 13, 2024 · 1 comment · May be fixed by #31539
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library.

Comments

@StephenWeatherford
Copy link

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cpim/resource-manager/Microsoft.AzureActiveDirectory/preview/2023-05-17-preview/externalIdentities.json

API Spec version

preview/2023-05-17-preview

Describe the bug

The location enum is empty in the JSON schema, which I believe is invalid for draft-04. At any rate, VS's schema code flags it as an error, which is causing a blocking bug in the Azure ARM Tools extension for VSCode:

    "ciamDirectories": {
      "description": "Microsoft.AzureActiveDirectory/ciamDirectories",
      "properties": {
        "apiVersion": {
          "enum": [
            "2023-05-17-preview"
          ],
          "type": "string"
        },
        "location": {
          "description": "The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to [this documentation](https://aka.ms/ciam-data-location) for more information.",
          "oneOf": [
            {
              "enum": [],                // <<<<<<<<<<<<<<<<<<<<<<< INVALID EMPTY ENUM
              "type": "string"

I think the swagger definition is here:

Expected behavior

The enum should not be invalid, and the schema should be http://json-schema.org/draft-04/schema# compliant.

Actual behavior

The following error occurs in the Azure ARM Tools extension in VS Code if I try to update it to use the newest schemas:
microsoft/vscode-azurearmtools#1733 (comment):

[Error - 4:27:28 PM] There are problems with this document's schema impacting one or more items in the document. Please report this issue to schema owner.

[Error - 4:27:28 PM]     Value must conform to at least one of the associated schemas
    |   Referenced item does not validate against the current schema.
    |   The issue encountered is "There must be at least 1 and at most 9223372036854775807 items defined in the array" at ../2023-05-17-preview/Microsoft.AzureActiveDirectory.json#/resourceDefinitions/ciamDirectories/properties/location/oneOf/0/enum at #/resourceDefinitions/ciamDirectories/properties/location/oneOf/0/enum
    |   or
    |   Value must be one of the following types: array
    at (line 530, column 5) in document https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json
    at schema text "resource"

[Error - 4:27:28 PM]     Value must conform to at least one of the associated schemas
    |   Value must be one of the following types: boolean
    |   or
    |   Referenced item does not validate against the current schema.
    |   The issue encountered is "There must be at least 1 and at most 9223372036854775807 items defined in the array" at ../2023-05-17-preview/Microsoft.AzureActiveDirectory.json#/resourceDefinitions/ciamDirectories/properties/location/oneOf/0/enum at #/resourceDefinitions/ciamDirectories/properties/location/oneOf/0/enum
    at (line 530, column 5) in document https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json
    at schema text "resource"

[Info  - 4:27:28 PM] Published 1 errors, 0 warnings for untitled:Untitled-2

Reproduction Steps

See above

Environment

N/A

@StephenWeatherford StephenWeatherford added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 13, 2024
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Nov 14, 2024
@v-jiaodi
Copy link
Member

@AndresZourelli Please help take a look, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Mgmt This issue is related to a management-plane library.
Projects
None yet
3 participants