[Breaking Change] Cross-Version Runtime Exception: Data does not match any schemas from 'oneOf' (AutoRest v2 -> v3)
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
The Breaking Changes check in PR [26672](https://github.com/Azure/azure-rest-api-specs/pull/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":
```
"NameSpaceCreate": {
"$ref": "./examples/NameSpaces/EHNamespaceFailover.json"
}
```
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:
```
"responses": {
"202": {
"headers": {
"azure-asyncoperation": "http://azure.async.operation/status",
"location": "eastus"
}
}
}
```
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.
Contributor guide
Assessment
This issue has not been assessed yet.