Skip to content

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

@mikeharder

Description

@mikeharder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions