api-specifications
Welcome to API Specifications!
This project contains OpenAPI specifications for the Image Intelligence API. There are currently two versions of our API (api-v1.json and v2/Api.js). Note that V1 will be marked for deprecation soon after the release of V2. If you've just started out, please build against V2.
Installation & Usage
npm install @image-intelligence/api-specification
import ApiSpec from '@image-intelligence/api-specification';
console.log(ApiSpec.v1);
console.log(ApiSpec.v2);
console.log(JSON.stringify(ApiSpec.v2, null, 2));
Development & Swagger
git clone git@github.com:ImageIntelligence/api-specification.git
When you're making changes to the API specification, it is often useful to verify the schema is valid:
npm install -g swagger-cli
swagger-cli help
swagger-cli validate xxx.json
Our JSON schema is generated from JavaScript files. To generate the schema:
node -e "console.log(JSON.stringify(require('./index').v2, null, 2))" | jq .
node -e "console.log(JSON.stringify(require('./index').v2, null, 2))" >! schema.json
node -e "console.log(JSON.stringify(require('./index').v2, null, 2))" | pbcopy
When editing the schema, perhaps you want a preview of your changes. The Swagger Editor can be useful here.
Not sure what Swagger or OpenAPI is? Check out this article.
Deployment
To publish a new version of api-specifications, update "version"
in package.json
and then create a GitHub Release.