作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 lb4 生成器创建模型、存储库和 Controller 。
向模型添加新字段时,我的 POST 将开始失败并出现以下错误:500 错误:模式无效:data.$ref 应该匹配格式“uri-reference”
错误太含糊了,我对它的要求零引用。
比较时验证失败:
$schema = http://json-schema.org/draft-07/schema
$ref = #/components/schemas/新用户
编辑:显然,如果您向 Controller 添加标题选项,它不知道如何处理自己
最佳答案
只需从@requestBody 中删除标题即可。尝试以下操作:
@requestBody({
content: {
'application/json': {
schema: getModelSchemaRef(Population, {
//title: "Add"
exclude: ['id']
})
}
}
关于loopbackjs - 这是什么意思? 500 错误 : schema is invalid: data. $ref 应匹配格式 "uri-reference",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60588848/
我是一名优秀的程序员,十分优秀!