Description
I'm having trouble understanding how the tool works.
I want to generate an output spec file to try to feed to Readme.
For that, I do the following:
- git clone https://github.com/alchemyplatform/docs-openapi-specs
- npm i
- cp .env.template .env
- Set up the Readme key in RDME_API_KEY in .env.
- Try to create an output spec for an Ethereum method https://github.com/alchemyplatform/docs-openapi-specs/blob/main/ethereum/eth_getBalance.yaml — npm run create ethereum/eth_getBalance.yaml
First, it throws an error for the wrongly formatted operationID: error alchemy-operation-operationId-casing operationId must be kebab cased and without digits. components.pathItems.path.post.operationId
I experiment and change the value: operationId: eth-getBalance -> operationId: eth-getbalance
Now it throws an error while trying to get to the schemas.yaml file:
Linting spec
No results with a severity of 'error' found!
Uploading new spec.. 🧨
File path => ethereum/eth_getBalance.yaml
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
Error: Error resolving $ref pointer "/Users/username/Projects/components/schemas.yaml#/Id".
"/Users/username/Projects/components/schemas.yaml" not found.
at $Refs._resolve (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/refs.js:153:11)
at dereference$Ref (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:140:23)
at crawl (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:69:28)
at crawl (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:78:30)
at dereference$Ref (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:160:24)
at crawl (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:69:28)
at crawl (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:78:30)
at dereference$Ref (/Users/username/Projects/docs-openapi-specs/node_modules/@openapi-generator-plus/json-schema-ref-parser/lib/dereference.js:160:24) {
toJSON: [Function: toJSON],
[Symbol(nodejs.util.inspect.custom)]: [Function: inspect]
}
The components
folder is definitely where it's supposed to be ( in the docs-openapi-specs
folder) and the schemas.yaml
with all its content — in the components
folder. I don't understand why the script is trying to find it in /Projects/components
and not in /Projects/docs-openapi-specs/components
, but even I cp this folder to /Projects/
the scrips still throws the same error.
What am I doing wrong and how to reach the desired outcome — an output yaml file conforming to the OAPI standards, which I can feed to Readme and see what it generates from it?