Hey there - thanks for checking our API docs! 👋
This repo holds the OpenAPI specs that power our API Playgrounds at docs.alchemy.com/reference ("Try it" sections on the right).
- Clone the repo.
git clone https://github.com/alchemyplatform/docs-openapi-specs
- Install dev dependencies.
npm i
Feedback? Issues? Typos?
We are continuously trying to improve our docs - any help is very welcomed! 😀
You can:
- suggest edits (top right of Tutorials pages)
- share feedback using 'Did this page help you? sections (bottom of Tutorials / API Reference pages)
- open issues here
If you're feeling adventurous, feel free to open a pull request here.
You currently can only modify API playgrounds. For pages or markdown edits in API Reference, please use one of the above options.
Below section is WIP. Until we add ids to every spec, deploy specs as you normally would.
To speed up your development, 2 commands are now available.
npm run create spec.yaml
npm run update spec.yaml
You no longer need to run the rdme
command line directly to push to staging.
You also no longer need to pass an API key and readme id! 🎉
Make sure you first ran through the steps above.
- Clone
.env.template
into.env
.
cp .env.template .env
-
Grab Readme API key.
-
Update
RDME_API_KEY
in.env
.
Known issue: will remove comments and format spec when run.
-
Write your spec (e.g.
newspec.yaml
). -
Run
create
script passing the path to your spec.
npm run create transact/newspec.yaml
This will:
- deploy your spec to readme
- create a page and id
- associate page id with your spec
- Your spec will be updated with a
x-readme.id
field. This is super important to ensure updates work smoothly in the future!
Run update
script. Ensure x-readme.id
is set.
npm run update spec.yml
- Check
RDME_API_KEY
is set in.env
. - Check you provided a valid path to a
.yaml
file when running the scripts.
npm run create spec.yaml
npm run update spec.yaml
- Check the spec has a
x-readme.id
property. This id is used to match the spec on Readme's side. - Reach out to Bastien if you have any issues running the scripts.
Linting is ran automatically when using npm run create
and npm run update
(powered by Spectral).
You can run it manually using
npx spectral lint spec.yaml
Rules we currently adhere - here.
You should also install the extension for your editor.
We currently cannot use oas-normalize
to resolve $refs in specs.
It relies on @readme/openapi-parser
which relies on @readme/json-schema-ref-parser
.
@readme/json-schema-ref-parser
is a fork of @apidevtools/json-schema-ref-parser
.
This is a known issue of json-schema-ref-parser
- see here.
Until the issue gets resolved and changes get merged upstream, solution is to dereference the spec using @openapi-generator-plus/json-schema-ref-parser
(https://www.npmjs.com/package/@openapi-generator-plus/json-schema-ref-parser).
This also means validation is done prior to running scripts via Spectral rather than with oas-normalize
.
- Refactoring (OAS Components / Schemas, break up
nfts.yaml
,sdk.yaml
). - More linting rules
- update multiple specs at once
create
andupdate
scripts share a lot of code (can be simplified)create
script remove comments