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

False positives when readOnly property using referenced enum #286

Open
cataggar opened this issue Nov 17, 2023 · 1 comment
Open

False positives when readOnly property using referenced enum #286

cataggar opened this issue Nov 17, 2023 · 1 comment

Comments

@cataggar
Copy link
Member

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

To Reproduce
As an example from that PR:

@doc("Subscription trial availability")
model Trial {
  @doc("Trial status")
  @visibility("read")
  status?: TrialStatus;

It does produce readOnly.

        "status": {
          "$ref": "#/definitions/TrialStatus",
          "description": "Trial status",
          "readOnly": true
        },

But before it was not a $ref, it was inline:

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

@mikekistler
Copy link
Member

This is a bit of a grey area since technically sibling properties of $ref should be ignored, but autorest is explicit about exceptions to this rule, and readOnly is one of the exceptions.

https://github.com/Azure/autorest/blob/main/docs/openapi/howto/%24ref-siblings.md

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

2 participants