oav generate-examples cannot read swagger from uri
- Dominant language
- TypeScript
- Stars
- 104
- Forks
- 62
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 5
Description
```
➜ oav generate-examples openapi.json
{
message: `fatal error: ENOENT: no such file or directory, open 'https:/raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json', {"errno":-2,"code":"ENOENT","syscall":"open","path":"https:/raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json"}`,
level: '\x1B[31merror\x1B[39m'
}
fatal error: ENOENT: no such file or directory, open 'https:/raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json', {"errno":-2,"code":"ENOENT","syscall":"open","path":"https:/raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json"}
```
openapi.json snippet:
```
"/providers/Microsoft.Contoso/operations": {
"get": {
"operationId": "Operations_List",
"summary": "List the operations for Microsoft.Consoto",
"parameters": [
{
"$ref": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "ARM operation completed successfully.",
"schema": {
"$ref": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json#/definitions/OperationListResult"
}
},
"default": {
"description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.",
"schema": {
"$ref": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
}
}
},
"tags": [
"Operations"
],
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
```
Contributor guide
Research direction
Start with the `oav generate-examples` entry point and reproduce the failure using the shown `openapi.json` and remote `$ref` URI. Trace how the URI is read, then verify that the remote Swagger document and its referenced definitions and parameters can be resolved instead of being treated as a local file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100