swagger - 如何引用与属性相同的架构?
问题描述
我的 oas.yaml 文件中有以下内容:
components:
schemas:
ServiceError:
type: object
properties:
Message:
type: string
description: "The exception message."
ExceptionMessage:
type: string
Type:
type: string
description: "The exception type.""
InnerError:
$ref: '#/components/schemas/ServiceError'
description: "If there's an inner exception, the InnerException.
Property:
type: object
properties:
Name:
type: string
description: Name of the property.
它不喜欢“描述:”如果有内部异常,则 InnerException。“如果我删除它,它不喜欢“属性:”行。我尝试了很多东西,但没有任何效果。什么我不明白吗?
解决方案
- a
description
是不允许的$ref
。看到这个答案。 - 之前
InnnerError
是两个'"'。不确定这是否只是复制粘贴错误。
推荐阅读
- eclipse - Scala Eclipse IDE 不会通过 Gradle 引入外部依赖项
- c++ - 对我所有函数的未定义引用 C++ 我认为这可能是因为我的 makefile
- mongodb - MongoDB $in 内 $cond
- python - 在 Django 中搜索期间分页不起作用
- jquery - 在两列布局中切换特定列?
- android - 如何清除/删除 Webview 的 Web 存储
- python-3.x - Gtk.PrintOperation.run () 没有响应
- haskell - Stack 坚持构建 Cabal 包
- javascript - 如何在 phpMyAdmin 中调用和显示数据库
- django - Django 将表单实例保存到不同的数据库