我正在尝试在Node.js上开发服务器。有一个POST请求,我需要发送grade
的值,该值可以是整数或null
。我尝试了任何类型的方法,但没有成功。
这是我的API定义:
swagger: "2.0"
paths:
/credits/operations:
post:
operationId: "creditsOperationsPOST"
parameters:
- in: "body"
name: "credito"
required: false
schema:
$ref: "#/definitions/credito"
responses:
200:
description: "Created"
x-swagger-router-controller: "Credits"
definitions:
credito:
type: "object"
properties:
sgecode:
type: "string"
grade:
type: "integer"
x-nullable: true
有人可以帮我吗?
答案 0 :(得分:-1)
我找到了一种使用null和integer的方法。在YAML文件上,我添加了
while(row.hasnext())
{
r = row.next();
}
对我来说很好。