### Install Dev Dependencies Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Installs the necessary development dependencies for the project using npm. ```bash npm i ``` -------------------------------- ### OpenAPI Specification Structure Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md An example of how an OpenAPI specification might be structured, including API endpoints, parameters, and responses. ```yaml openapi: 3.0.0 info: title: Alchemy API version: v1 paths: /eth-mainnet/v1/{apiKey}: get: summary: Get Ethereum Mainnet Data parameters: - name: apiKey in: path required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: type: object properties: balance: type: string ``` -------------------------------- ### Create New OpenAPI Spec Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Creates a new OpenAPI spec by deploying it to Readme, creating a page and ID, and associating the ID with the spec. This script also handles linting. ```bash npm run create transact/newspec.yaml ``` -------------------------------- ### Manual Linting with Spectral Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Manually runs Spectral linting on a specified OpenAPI YAML file. ```bash npx spectral lint spec.yaml ``` -------------------------------- ### Clone Repository Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Clones the Alchemy OpenAPI specs repository from GitHub. ```bash git clone https://github.com/alchemyplatform/docs-openapi-specs ``` -------------------------------- ### Copy Environment Template Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Copies the environment template file to create a new environment configuration file. ```bash cp .env.template .env ``` -------------------------------- ### Spectral Linting Rules Configuration Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Configuration file for Spectral, defining the linting rules to be applied to OpenAPI specifications. ```yaml extends: spectral:oas rules: operation-summary: error path-declaration-case: error ``` -------------------------------- ### Dereferencing OpenAPI Specs Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Explains the need for dereferencing OpenAPI specs due to issues with $ref resolution and suggests using a specific npm package as a workaround. ```javascript // Workaround for $ref resolution issues: // npm install @openapi-generator-plus/json-schema-ref-parser // const refParser = require('@openapi-generator-plus/json-schema-ref-parser'); // refParser.dereference(spec).then(dereferencedSpec => { ... }); ``` -------------------------------- ### Update Existing OpenAPI Spec Source: https://github.com/alchemyplatform/docs-openapi-specs/blob/main/README.md Updates an existing OpenAPI spec on Readme. It requires the spec to have a 'x-readme.id' property for proper matching. ```bash npm run update spec.yml ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.