【发布时间】:2015-12-06 17:59:00
【问题描述】:
我创建了一个名为 Product 的定义和另一个名为 Text 的定义(参见代码)。
在parameters 的paths 上,我不能使用在定义中创建的类型Text。在Product 的定义上,我有一个名为message 的属性,我希望该属性也是Text 类型。
(...)
paths:
/products:
get:
summary: Product Types
description: |
Description text
parameters:
- name: latitude
in: query
description: Latitude component of location.
required: true
### The type Text was not found here
type: Text ### The type Text was not found here
(...)
definitions:
Product:
properties:
message:
### The type Text was not found here
type: Text ### Compilation Error in this line ####
name:
type: string
description: Data description.
Text:
properties:
code:
type: string
但是出现这个错误:
招摇错误: 数据与“anyOf”中的任何模式都不匹配。
如何在Product 类型上引用Text 类型?
【问题讨论】:
标签: yaml swagger swagger-2.0 swagger-editor