1

我有 2 个不同的 restful api-s,我想使用 Tyk 作为网关。

我的计划是有一个通用的 url(比如:http://viktorservices),它可以向这两个 api 端点发送消息。

例如,第一个 api 是用户管理器 api,并且有一个端点:

GET: http://localhost:8080/usermanager/users

另一个 api 是汽车管理器 api,它是端点:

GET: http://localhost:8081/carmanager/cars

是否有可能以某种方式为 Tyk 目录(用于开发人员门户)上传 Swagger JSON,以便只能设置一个名为:用户和汽车管理器的 API ?

当我在 Tyk 的开发人员站点中单击“查看文档”时,两个 API 的所有端点都是可见的,按它们的主要 API 名称分组?

我试图将两个 swagger json 作为一个数组放在一个中,但是在开发人员站点上它是不可见的。

我能够一一上传招摇,但随后我将在 Tyk 的 Dev 站点上有两个 API-s。

4

1 回答 1

1

I think the main point here is that developer portal documentation/swagger does not have to correlate with the actual APIs you have. Portal gets organized by catalogues/policies. So you can have multiple internal Tyk APIs, but expose them as the single catalog in Portal, by creating Policy which gives access to both APIs. So, just create new "public" swagger file for documentation purpose, which includes endpoints from both of your internal APIs.

Does it make sense?

于 2018-07-03T10:58:36.313 回答