是否可以在IBM API Connect的API路径中使用通配符 [英] Is it possible to use wildcards in API paths in IBM API Connect

查看:74
本文介绍了是否可以在IBM API Connect的API路径中使用通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将所有符合某种模式的API调用路由到特定服务.例如,"/register/student","register/teacher","register/employee"都应转到一个微服务.我可以使用通配符或模式定义上述路径(而不是每个API的绝对路径),以便与模式"/register/**"匹配的任何请求都应转到一个特定的微服务.

I have a requirement to route all the API calls which meets some pattern, to a specific service. For example "/register/student", "register/teacher", "register/employee" should all go to one micro service. Can I define the above path (not absolute path for each API) using some wild card or pattern so that any request which matches the patter: "/register/**", should go to one specific micro service.

推荐答案

您可以在路径定义中使用路径参数和操作开关来控制各种模式的流.

You can do it in the path definition using path parameters and operation switches to control the flow of various patterns.

paths:
  'register/{myParam}':
    get:
      responses:
        '200':
          description: 200 OK
    parameters:
      - name: myParam
        type: string
        in: path
        required: true

这篇关于是否可以在IBM API Connect的API路径中使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆