Azure / Azure/openapi-diff

False positives when readOnly property using referenced enum

Aperta
#286 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
290
Fork
50
Merge medio
5g 13h
PR unite (30g)
5

Descrizione

**Describe the bug**

I'm working on https://github.com/Azure/azure-rest-api-specs-pr/pull/15631 and there are a lot of false positives with a message of `The read only property has changed from 'true' to 'false'.

![image](https://github.com/Azure/typespec-azure/assets/87583576/60ec9d9a-3bb8-453c-b3fc-6d5c8846e119)

**To Reproduce**
As an example from that PR:
``` typespec
@doc("Subscription trial availability")
model Trial {
@doc("Trial status")
@visibility("read")
status?: TrialStatus;
```

It does produce `readOnly`.
``` json
"status": {
"$ref": "#/definitions/TrialStatus",
"description": "Trial status",
"readOnly": true
},
```

But before it was not a `$ref`, it was inline:
```json
"status": {
"description": "Trial status",
"type": "string",
"enum": [
"TrialAvailable",
"TrialUsed",
"TrialDisabled"
],
"readOnly": true,
"x-ms-enum": {
"name": "TrialStatus",
"modelAsString": true
}
},
```

**Expected behavior**
It is not marked as a breaking change.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.