v2.0.0 (2021-05-24) New Bump CLI to interact with your API documentation
Welcome to the new Bump CLI 🎉
It was written with care in Typescript to replace our old ruby gem. Why the change? Mostly because the OpenAPI and AsyncAPI communities have many tools written in Typescript or Javascript and we want to follow their experienced lead. By getting closer to those two world we hope to be able to contribute more too.
Typescript will help us to publish a stable & type safe CLI. On top of that - and especially with the oclif framework - we will be able to publish universal packages for multiple OSes & architectures so everybody can enjoy Bump via command line interface.
Get it while it's hot
npm install -g bump-cli
Enjoy !
bump previewto build as many API documentation preview as you want.bump deploy --dry-runto validate your future API documentation deployment.bump deployto deploy your latest API documentation changes.
🆕 What's new
This new CLI is iso-feature with our old CLI package. However there is one major improvement, we now support recursive external references ($ref keyword in your API specifications), with mixed file or URL access. You can now refactor your API definitions in small chunks, re-use parts of it, and separate concerns between endpoints, models or nested-objects.
Here's a modified example from the official Gitlab API openapi definition:
openapi.yml
openapi: 3.0.0
info:
description: |
An OpenAPI definition for the GitLab REST API.
version: v4
title: GitLab API
paths:
# ...
# ACCESS REQUESTS (PROJECTS)
/v4/projects/{id}/access_requests:
$ref: 'v4/access_requests.yaml#/accessRequestsProjects'
# ..../v4/access_requests.yaml
accessRequestsProjects:
get:
description: Lists access requests for a project
parameters:
- name: id
in: path
responses:
'200':
description: Successful operation
content:
application/json:
$ref: 'models/ProjectAccessResponse.yaml'./v4/models/ProjectAccessResponse.yaml
schema:
title: ProjectAccessResponse
type: object
properties:
id:
type: integer
usename:
type: string
example:
- "id": 1
"username": "raymond_smith"Note: we limit the recursion up to a depth of 5. Please contact us if you hit this limit so we can discuss your use-case.
⚠️ Breaking change compared to our old CLI
The old bump validate command has disappeared in favor of a deployment simulation command with bump deploy --dry-run