我创建了一个名为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
但是会出现这个错误:
Swagger 错误:数据与“anyOf”中的任何模式都不匹配。
如何在类型Text
上引用类型Product
?