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

Fix validation for readOnly $ref properties #999

Open
Yosi-Hezi opened this issue Sep 19, 2023 · 2 comments
Open

Fix validation for readOnly $ref properties #999

Yosi-Hezi opened this issue Sep 19, 2023 · 2 comments

Comments

@Yosi-Hezi
Copy link

Yosi-Hezi commented Sep 19, 2023

The "readOnly" keyword of $ref properties is ignored by oav validation process.

Full context:
My team and I are developing a new RP via RPaaS and we have RPaaS validation enabled. We expect read-only properties that are sent as part of the request to be discarded. Instead, if they are defined with the $ref keyword (see example below), they go through and override the existing values of these properties in RPaaS database.
I might be wrong, but I heard that RPaaS are using oav tools to perform their validation task (including the removal of read-only fields from the request body). Is this true? If it is, can this be fixed? Thanks in advance.

Example of a property defined with the $ref keyword:

"systemData": {
          "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData",
          "description": "Azure Resource Manager metadata containing createdBy and modifiedBy information",
          "readOnly": true // This is ignored by oav
        }
@mikeharder
Copy link
Member

Root cause might be a dependency on a tool that ignores siblings of $ref. More info: Azure/azure-openapi-validator#706

@mikeharder
Copy link
Member

Possible dup of #848

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