Swagger 大摇大摆的编辑说:不完全是来自<#/定义/参数><#/定义/jsonReference>;
我正试图为我的API定义一个招摇过市的文档。大摇大摆的编辑一直说,与, 我检查了规范,参数应该有Swagger 大摇大摆的编辑说:不完全是来自<#/定义/参数><#/定义/jsonReference>;,swagger,swagger-editor,Swagger,Swagger Editor,我正试图为我的API定义一个招摇过市的文档。大摇大摆的编辑一直说,与, 我检查了规范,参数应该有name,in required,description和default如果没有in:body 谢谢 { "swagger": "2.0", "info": { "version": "1.0.0", "title": "semantify.it spec", "description": "Semantify.it. The APIs can be used to
name,in required,description
和default
如果没有in:body
谢谢
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "semantify.it spec",
"description": "Semantify.it. The APIs can be used to read, update, create and delete values inside the semantify.it database.",
"termsOfService": "http://swagger.io/terms/"
},
"basePath": "/api",
"schemes": [
"http",
"https"
],
"paths": {
"/login": {
"post": {
"tags": [
"Login, Register"
],
"consumes": [
"application/x-www-form-urlencoded"
],
"description": "Login and get a Token",
"parameters": [
{
"name": "identifier",
"in": "formData",
"required": true,
"default": "test-user",
"description": "username or email"
},
{
"name": "password",
"in": "formData",
"required": true,
"default": "test-pass"
}
],
"responses": {
"200": {
"description": "Login success"
}
}
}
}
}
}
有两个问题:
1) 参数缺少类型
,例如“类型”:“字符串”
2) 默认值
不与所需参数一起使用,仅与可选参数一起使用。默认值是当客户端不发送此参数时服务器使用的值。但是,如果需要参数,客户端必须始终发送它,并且从不使用默认值