Swagger投掷“不是有效的参数定义”

时间:2016-11-15 20:21:28

标签: swagger swagger-ui swagger-editor

我正在使用Swagger UI创建API文档。我有很多错误,说“不是一个有效的参数定义”,我不知道为什么。谁能说出这是怎么回事?我包括代码的一部分和带有行号和错误描述的图片。

招摇的例子

bool operator<(wahl lhs, wahl rhs);
bool operator>(wahl lhs, wahl rhs);

招摇错误

enter image description here

1 个答案:

答案 0 :(得分:2)

当您使用switch (item.getItemId()) { case android.R.id.home: finish(); return true; } 时,规范需要in: body元素,例如:

schema

如果您使用body参数 ,则需要使用原始值,例如name: user in: body schema: type: object properties: userId: type: string