Azure / Azure/openapi-diff

False positives when readOnly property using referenced enum

Đang mở
#286 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
290
Fork
50
Merge trung bình
5 ngày 13 giờ
Pull request đã merge (30 ngày)
5

Mô tả

**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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by inspecting the comparison described in Azure/azure-rest-api-specs-pr#15631, using the Trial model and referenced TrialStatus enum as the reproduction case. Trace where the diff compares the previous inline enum schema with the new $ref schema and readOnly value. Done means this equivalent change is no longer reported as a breaking readOnly change.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, openapi
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.