kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
253 stars 21 forks source link

CLI: Overlays #961

Open jasmingacic opened 1 year ago

jasmingacic commented 1 year ago

Overlays implementation should be done in the CLI to resemble something like

kusk deploy -i openapi.yaml  --overlay path/to/overlay

and

kusk generate -i openapi.yaml  --overlay path/to/overlay

To speed up the process we should us this library https://github.com/ponelat/overlays-cli to have it done. Since it is a JS app we need to package it using https://github.com/vercel/pkg.

The binary should go into embeded binaries in go code. Having it this way will spare users of unnecessary steps to install it.

If overlay parameter is present in CLI parameters we'd invoke that binary and pass openapi spec with the overlay file and collect the output.

We should allow users to pass overlay file which contains yaml property extends to put together final OpenAPI spec.

extends: https://petstore3.swagger.io/api/v3/openapi.json

p.s. @aabedraba should I reach out to Ponelat for permission to use his project?

aabedraba commented 1 year ago

I think deploying the overlay directly will make sense, given the details for the OpenAPI will be in the extends keyword:

kusk deploy -i overlay.yaml

The CLI would then need to detect if it's an Overlay or an OpenAPI file.


I will reach to Josh.