oas version incompatibility
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 697
- Forks
- 31
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 10
Description
hi, we are getting the error below after generating the api:
.api/apis/sivocom/index.ts:13:29 - error TS2345: Argument of type 'import("/[redacted]/.api/apis/sivocom/node_modules/oas/dist/index")' is not assignable to parameter of type 'import("/[redacted]/.api/apis/sivocom/node_modules/api/node_modules/oas/dist/index").default'.
Property 'promises' is protected but type 'Oas' is not a class derived from 'Oas'.
13 this.core = new APICore(this.spec, 'sivocom/1.0 (api/6.1.3)');
it seems to be related to incompatible versions of oas in package.json. the main package.json that is generated has this:
"dependencies": {
"api": "^6.1.3",
"json-schema-to-ts": "^2.8.0-beta.0",
"oas": "^32.0.0"
}
while the package.json for @readme/oas-to-har has the following:
"dependencies": {
"@readme/data-urls": "^1.0.1",
"@readme/oas-extensions": "^17.0.1",
"oas": "^20.5.0",
"qs": "^6.10.5",
"remove-undefined-objects": "^2.0.2"
},
is it possible to configure the dependencies so they resolve oas to the same version? thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the generated main package.json with the package.json for @readme/oas-to-har, focusing on their oas dependency versions and the generated .api/apis/sivocom/index.ts import. Inspect how api and its nested oas dependency are resolved, then verify that the generated TypeScript API compiles without the reported type incompatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100