Open mikekistler opened 10 months ago
Related investigation:
More discussion of oneOf
in this Teams thread
Key observation from Timothee Guerin about oneOf
being unhelpful error message:
Mentioned earlier but with autorest v3 I migrated to a newer json schema which allows if then which gives a much better error Like similar to what editor.swagger.io does
Re the breaking change labelling issue in:
Mike wrote:
Approving breaking changes because https://github.com/Azure/azure-sdk-tools/issues/7278. Manual inspection of the diff shows no breaking changes.
Recall the failure was AutoRest error:
ERROR: Schema violation: No enum match for: operation-location
Per my comment here:
Key observation from Timothee Guerin about oneOf being unhelpful error message:
Mentioned earlier but with autorest v3 I migrated to a newer json schema which allows if then which >> gives a much better error Like similar to what editor.swagger.io does
Because AutoRest invoked by openapi-diff
failed, the downstream automation (in openapi-alps
repo) that classifies breaking change failures didn't run. That downstream automation can quell the check if all the failures are benign. Basically, this kind of observed failure is imprecise and currently requires manual effort. We could work on updating to AutoRest v3, which hopefully would make the error better and would allow easier manual investigation and maybe even better automated determination what is the issue. But then we need to prioritize for it, and it is unclear how hard it would be to do the migration. It may impact what and when fails validation. We use AutoRest also in LintDiff, ModelValidation and SemanticValidation. If we don't update it there, this might lead to inconsistent behavior across checks.
Doc on AutoRest migration from v2 to v3:
Additional context on Teams here
about this PR:
The Breaking Changes check in PR 26672 failed with a runtime exception with "ERROR: Schema violation: Data does not match any schemas from 'oneOf'.
The exception points to an "x-ms-example":
for an operation with a 202 response that includes an "Azure-AsyncOperation" and a "location" response header. And the example included both of these headers:
Through trial and error, I determined that the "location" header was causing the exception, and with a little more experimenting I found that the value had to be a URL. That makes sense, except that the OpenAPI only defined "location" as a "string". Strange!
Anyway, fixing the value of "location" in the example to be a valid URL fixed the runtime exception.