bump-sh / cli

Bump.sh CLI - Deploy your OpenAPI & AsyncAPI documentations from your CI
https://bump.sh
MIT License
39 stars 2 forks source link

Add a new `overlay` command to be able to apply OpenAPI overlays on given API document #553

Closed paulRbr closed 5 months ago

paulRbr commented 8 months ago

Together with the guide written by Phil on OpenAPI overlays, we thought it would be a good idea to release a new bump overlay command in the CLI in order to test the new OpenAPI Overlay specification.

This WIP change is based on @lornajane's work on overlays with a few changes here and there.

I've published the resulting built package from this branch as a beta version on npmjs registry so you can test a beta version of Bump CLI installable with:

npm install bump-cli@beta

Example usage

Note: the input API document file name is used to detect the target output overlayed document (Json or Yaml)

bump overlay ../bump/doc/api/v1/openapi.v3.yml ../bump/doc/api/v1/overlay.yaml --out ../bump/doc/api/v1/openapi.v3.overlayed.yml
bump deploy ../bump/doc/api/v1/openapi.v3.yml --overlay ../bump/doc/api/v1/overlay.yaml --doc my-doc --token --my-token
philsturgeon commented 8 months ago

Can we pop in a Thanks section on the README and put Lorna Mitchel on there?

We've done this for Spectral, Prism, and I recommend it for any tool which has substantial contribution from a single contributor, like this.

https://github.com/stoplightio/spectral#-thanks

paulRbr commented 6 months ago

@scharrier following your review, I've moved things around to make it clearer (I think). Basically all the “command” related feature is in the new commands/overlay.ts file while all the things around the definition (format, applying overlay...) is in the APIdefinition model.

I think it makes more sense like this. Let me know if it suits you!