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

[AvoidAnonymousTypes] False positive on ManagedServiceIdentity generated from TypeSpec #747

Open
mikeharder opened this issue Sep 26, 2024 · 0 comments

Comments

@mikeharder
Copy link
Member

Problem

Rule AvoidAnonymousTypes raises a false-positive error on UserAssignedIdentity generated from TypeSpec.

TypeSpec

  ...ManagedServiceIdentityProperty;

Swagger

"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityUpdate": {
  "type": "object",
  "description": "Managed service identity (system assigned and/or user assigned identities)",
  "properties": {
    "type": {
      "$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/ManagedServiceIdentityType",
      "description": "The type of managed identity assigned to this resource."
    },
    "userAssignedIdentities": {
      "type": "object",
      "description": "The identities assigned to this resource by the user.",
      "additionalProperties": {
        "allOf": [
          {
            "$ref": "../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
          }
        ],
        "type": "object",
        "x-nullable": true
      }
    }
  }
},

Workaround

Suppress in readme.md until root cause is addressed

Example

https://github.com/Azure/azure-rest-api-specs-pr/pull/19710/checks?check_run_id=30708435029

Related

Azure/typespec-azure#1058.

@mikeharder mikeharder changed the title [AvoidAnonymousTypes] False positive on UserAssignedIdentity generated from TypeSpec [AvoidAnonymousTypes] False positive on ManagedServiceIdentity generated from TypeSpec Sep 26, 2024
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