My APIs use Swagger (in my case @nestjs/swagger) to expose their documentation. I use the generated specification to automatically generate the openapi.yaml file.
And when deploying the service, Kusk automatically merge the deployed openapi.yaml with the result of the request on x-kusk.upstream.openapi.path.
This way the ìnfo and the openapi is also gathered from the service.
Why I think this feature is important ?
It is the first time I use an API Gateway, before I was writing it myself. Everytime I was creating a new endpoint on one of my service I had to also add it to my Gateway to proxy the request.
When I checked all the API Gateway tools, it was the same result: Having to rewrite the specification of each path of each service somewhere.
Using the OpenAPI to manage the API Gateway is for me the most appropriate method. It is not because we do microservices that we do not have to follow standards. And frameworks like https://api-platform.com/ and https://nestjs.com/ provide incredible tools to create really Restful APIs
I think that this feature match completely the vision of Kusk. You have a new service serving a Restful API ? Deploy it, write few lines in a yaml file and boom, exposed.
:warning: A problem with mocks
The problem now is the mocking part, because we do not have the OpenAPIV3 specification without running the service.
I currently have no idea on how to handle that. I still opened this issue in case you have ideas.
A bit of context
My APIs use Swagger (in my case @nestjs/swagger) to expose their documentation. I use the generated specification to automatically generate the
openapi.yaml
file.How do I do currently ?
Here is the workflow I use in development:
openapi.yaml
fileopenapi.yaml
The enhancement
Most of restful APIs expose their OpenAPIV3 specifications and Kusk could directly gather it from the service.
I could have a simple
openapi.yaml
file:And when deploying the service, Kusk automatically merge the deployed
openapi.yaml
with the result of the request onx-kusk.upstream.openapi.path
.Why I think this feature is important ?
It is the first time I use an API Gateway, before I was writing it myself. Everytime I was creating a new endpoint on one of my service I had to also add it to my Gateway to proxy the request.
When I checked all the API Gateway tools, it was the same result: Having to rewrite the specification of each path of each service somewhere.
Using the OpenAPI to manage the API Gateway is for me the most appropriate method. It is not because we do microservices that we do not have to follow standards. And frameworks like https://api-platform.com/ and https://nestjs.com/ provide incredible tools to create really Restful APIs
I think that this feature match completely the vision of Kusk. You have a new service serving a Restful API ? Deploy it, write few lines in a yaml file and boom, exposed.
:warning: A problem with mocks
The problem now is the mocking part, because we do not have the OpenAPIV3 specification without running the service. I currently have no idea on how to handle that. I still opened this issue in case you have ideas.