The OpenAPI specification for the Neynar APIs. Sign up for an API key on neynar.com.
We use Spectral to lint and validate our OpenAPI specifications. Spectral helps ensure that the OpenAPI files are compliant with the OpenAPI specification and follow best practices.
You can install Spectral globally using Yarn:
yarn global add @stoplight/spectral-cli
To validate an OpenAPI specification file using Spectral, run:
spectral lint src/v1/spec.yaml
spectral lint src/v2/spec.yaml
spectral lint src/hub-rest-api/spec.yaml
Spectral will output any errors or warnings found in the specification files.
In addition to Spectral, you can use the Swagger CLI to validate your OpenAPI specifications.
You can install Swagger CLI globally using Yarn:
yarn global add swagger-cli
To validate an OpenAPI specification file using Swagger CLI, run:
v1
swagger-cli validate src/v1/spec.yaml
v2
swagger-cli validate src/v2/spec.yaml
hub-rest-api
swagger-cli validate src/hub-rest-api/spec.yaml
This will check for structural errors and report any issues.
We use OpenAPI Generator to generate client code from the OpenAPI specifications.
Prerequisite: Java must be installed.
Install OpenAPI Generator using Homebrew:
brew install openapi-generator
openapi-generator generate -i src/v1/spec.yaml -g typescript-axios -o src/v1/swagger-tmp
openapi-generator generate -i src/v2/spec.yaml -g typescript-axios -o src/v2/swagger-tmp
openapi-generator generate -i src/hub-rest-api/spec.yaml -g typescript-axios -o src/hub-rest-api/swagger-tmp
For other languages, replace <generator>
with a desired generator.