小编Kyl*_*ggs的帖子

UriTemplate 中使用的 Azure API 管理模板参数必须在 Operation 中定义,反之亦然

我有许多 Azure 函数,现在我想将 Azure API 管理放在前面。

我已经从我帐户中的 2 或 3 个其他函数应用程序中导入了所有函数,没有任何问题,但我在使用其中一个函数应用程序时遇到了问题。这个功能应用有6个功能,其中3个如果我专门选择可以导入。其他 3 个函数中的某些内容引发错误:

All template parameters used in the UriTemplate must be defined in the Operation, and vice-versa.

这里是 Azure 函数本身创建的我的 Swagger api 文档的相关部分:

    paths:
'/api/api-keys/{customerId}':
    delete:
    operationId: '/api/api-keys/{customerId}/delete'
    produces: []
    consumes: []
    parameters:
        - name: customerId
        in: path
        required: true
        type: string
    description: >-
        Replace with Operation Object
        #http://swagger.io/specification/#operationObject
    responses:
        '200':
        description: Success operation
    security:
        - apikeyQuery: []
'/api/api-keys/{customerId}/{apiKeyId}':
    delete:
    operationId: '/api/api-keys/{customerId}/{apiKeyId}/delete'
    produces: []
    consumes: []
    parameters:
        - name: …
Run Code Online (Sandbox Code Playgroud)

azure swagger azure-api-management azure-functions

6
推荐指数
2
解决办法
4158
查看次数