Azure / Azure/azure-rest-api-specs

[BUG] MSI Swagger, invalid definition of `readOnly`

Open
#36,238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Managed Identity
Dominant language
TypeSpec
Stars
3.1k
Forks
6k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/84f223e8bea800a1a0b503b8c28675abf91f92a2/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2024-11-30/ManagedIdentity.json#L541-L546

### API Spec version

all versions

### Describe the bug

### Context
`readOnly` on `properties` of `Identity` and `IdentityUpdate` is invalid in 2 senses:
#### 1. `readOnly` alongside `$ref` is not supported in OpenAPI 2.0/3.0

Image

Previously M4 will ignore this kind of definition.

#### 2. In reality, some of the properties in the `properties` are settable, the `properties` itself therefore shouldn't be defined as `readOnly`
`IsolationScope` in `UserAssignedIdentityProperties` is settable:

Image

Image

### Issue
Though in Swagger, `Identity`'s `properties` is defined as `readOnly`(which means not settable):
https://github.com/Azure/azure-rest-api-specs/blob/84f223e8bea800a1a0b503b8c28675abf91f92a2/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2024-11-30/ManagedIdentity.json#L539-L547

IMHO, it shouldn't be `readOnly`.

### Expected behavior

`Identity`'s `properties` shouldn't be defined as `readOnly`.

### Actual behavior

https://github.com/Azure/azure-rest-api-specs/blob/84f223e8bea800a1a0b503b8c28675abf91f92a2/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2024-11-30/ManagedIdentity.json#L539-L547

### Reproduction Steps

N/A

### Environment

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2024-11-30/ManagedIdentity.json around lines 539-547, then check the other API versions referenced by the issue. Verify the definitions of Identity and IdentityUpdate and remove the invalid readOnly declaration from properties where appropriate; done means the specifications validate and settable properties remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.