我的端点有一个 Swagger 文件,我的端点之一有几个参数。您如何处理非必需参数?如果非必需参数具有空值,我将面临如何在我的 Python 文件中处理它的挑战。
这是我的 Swagger 定义:
/surveyData:
get:
operationId: "surveyData.read_surveydata"
summary: Gets the survey data for the client insights tracker.
parameters:
- in: query
name: startDate
type: string
required: true
description: The start date of the survey data.
- in: query
name: endDate
type: string
required: true
description: The end date of the survey data.
- in: query
name: country
type: string
description: The countries from which you would like to filter the survey data.
- in: query
name: market
type: string
这是我用 Python 编写的函数(使用 Connexion):
def read_surveydata(startDate, endDate, country, market):