-
Notifications
You must be signed in to change notification settings - Fork 55
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
Flag when empty object is used for "schema" value in spec #443
Comments
That's correct, because empty schema means that it can be any value, ASFAIK. |
This is one that I think was using it as the "any" value https://github.com/Azure/azure-rest-api-specs/blob/master/specification/web/resource-manager/Microsoft.Web/stable/2016-06-01/logicAppsManagementClient.json#L634-L639 |
@nschonni , for the spec you referenced, this example would not fail. Can you clarify?
|
@raych1 the first one for application insights or the second web one? |
@nschonni , I updated above comment. Pls check. OAV would not flag when example body=""(which is empty case) and schema is empty. |
@raych1 yeah, I think it should flag it unless it's {
"parameters": {},
"responses": {
"200": {}
} Which is what passes if the empty schema is removed |
@nschonni , like @sergey-shandar said empty schema means it can be any value. That's why undefined body would be flagged but empty body wouldn't be flagged. |
Yeah, what I was suggesting here, is that the empty schema object is a valid value, but is more likely used incorrectly (single probably correct use case in the repo) vs. incorrectly used to hide other OAV warnings on DELETE operations. Since it's more likely not correct, it could be a warning and authors would get exceptions if they actually needed it |
@nschonni , can you share me an example of DELETE operation which incorrectly use the empty schema? |
The PR linked in the first post has the empty schema to hide the empty response |
Thanks @nschonni , I commented on the linked PR. |
OK, the original issue wasn't just about deletes, but I also doesn't look like it was that wide-spread |
In #436, OAV started to flag schema mismatches with the examples. Once case where these will still pass, is when the schema is defined as
Then things like
"body": ""
are still passing.EX: Azure/azure-rest-api-specs#6636
The text was updated successfully, but these errors were encountered: