-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Swagger ModelValidation erroneously fails when required x-ms-secret properties are omitted from responses in examples #20235
Comments
@keryul , can you check if this issue was fixed? |
hi @erjms , from the example of x-ms-secret documentation
x-ms-secret will not work when property has "$ref" I suggest the following changes to swagger and example
example file
|
Hi @keryul, thanks for responding. We are unable to make the suggested changes because our service's swagger has already been published as a stable version and they would constitute breaking changes. But more generally, could you please point me to where in the documentation it forbids applying |
Hi @erjms , we can find the relationship between x-ms-secret and x-ms-mutability in the fourth rule of x-ms-secret
then we can find the last rule of x-ms-mutability
"The mutability of the element will be governed based on the mutability defined in the element's definition."
"X - Applying mutability on the itemType of the array or valueType of the dictionary is not allowed." A more convenient way is to imagine every property has its own x-ms-secret, with a default value of false.
|
From the x-ms-secret documentation:
The Swagger ModelValidation pipeline fails for this scenario, erroneously flagging properties that match this scenario that are missing from example responses as errors, e.g.:
https://github.com/Azure/azure-rest-api-specs/pull/18645/checks?check_run_id=6586657182
The text was updated successfully, but these errors were encountered: