首页 > 解决方案 > Maintaining multiple API representations in an API Gateway for a set of Spring Boot Microservices

问题描述

I am using AWS API Gateway and would like to construct multiple API's for a set of Spring Boot micro-services that exist behind the scenes, but do so automatically.

For example, lets say I have a User and Contract Micro-service and they expose a simple CRUD, I would like to make 2 API representations inside the API Gateway for these 2 micro-services however they will be in the context of an Admin and a User.

The Admin API would have full access to all operations (CRUD) of both micro-services, however, the User API would only allow Read from both micro-services.

My question is about maintaining the representation of these 2 API contexts (Admin and User) is there any way to easily generate the swagger(s) that I would need that I can synchronize the API Gateway with without having to manually maintain this? Or is there a better approach that others are doing that im missing?

I have found spring fox which I was able to use and generate the swagger defs for the API at the microservice levels, but this only satisfies the Admin Use case and not the User one from what I can tell.

Has anyone found an elegant solution to this?

标签: spring-bootaws-api-gateway

解决方案


推荐阅读