当我使用serverless openapi generate
时,生成的openapi.yaml
不包含任何参数
我尝试使用参数而不是queryParams和pathParams
functions:
get:
handler: retransmit/get.get
events:
- http:
path: retransmit/{game_id}/{camera_id}
method: get
cors: true
documentation:
summary: "Fetch frame_id"
description: "Fetch frame_id ranges for given grab_id and camera_id"
queryParams:
- name: "game_id"
description: "app id"
required: true
- name: "camera_id"
description: "user id or 'my'"
required: true
错误:
Semantic error at paths./retransmit/{game_id}/{camera_id}
Declared path parameter "game_id" needs to be defined as a path parameter at either the path or operation level
Jump to line 27
Semantic error at paths./retransmit/{game_id}/{camera_id}
Declared path parameter "camera_id" needs to be defined as a path parameter at either the path or operation level
Jump to line 27
答案 0 :(得分:0)
将 queryParams 更改为 pathParams
functions:
get:
handler: retransmit/get.get
events:
- http:
path: retransmit/{game_id}/{camera_id}
method: get
cors: true
documentation:
summary: "Fetch frame_id"
description: "Fetch frame_id ranges for given grab_id and camera_id"
pathParams:
- name: "game_id"
description: "app id"
required: true
- name: "camera_id"
description: "user id or 'my'"
required: true