Kyl*_*ggs 6 azure swagger azure-api-management azure-functions
我有许多 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: customerId
in: path
required: true
type: string
- name: apiKeyId
in: path
required: true
type: string
description: >-
Replace with Operation Object
#http://swagger.io/specification/#operationObject
responses:
'200':
description: Success operation
security:
- apikeyQuery: []
'/api/password-hashes/{customerId}/{prefix}':
get:
operationId: '/api/hashes/{customerId}/{prefix}/get'
produces: []
consumes: []
parameters:
- name: customerId
in: path
required: true
type: string
- name: prefix
in: path
required: true
type: string
description: >-
Replace with Operation Object
#http://swagger.io/specification/#operationObject
responses:
'200':
description: Success operation
security:
- apikeyQuery: []
Run Code Online (Sandbox Code Playgroud)
通过这个,我已经验证了参数中的所有项目都在路径中。我不确定这里是否有我遗漏的东西,但在互联网上环顾四周,我没有看到太多关于这个问题的信息。
更新(10/1/18):问题已修复。如果仍然可以重现,请清除浏览器缓存。
目前,Function App 导入根本不使用您为 Function App 定义的 OpenAPI 规范。相反,它直接使用 FunctionApp 定义。该问题是由您的函数具有带参数的路由引起的,例如 /route/{param}。这个问题很快就会得到解决。
现在应该可以了。
| 归档时间: |
|
| 查看次数: |
4158 次 |
| 最近记录: |