我想使用库中的类作为属性的类型。说是吧foo.lib.Foo。将其正确定义为属性类型的正确方法是什么?
SomeDto:
type: object
properties:
foo:
$ref: `foo.lib.Foo`???
Run Code Online (Sandbox Code Playgroud)
这可以通过定义类型映射并显式引用该类型来完成。
<configuration>
...
<importMappings>
<importMapping>Foo=foo.lib.Foo</importMapping>
</importMappings>
...
</configuration>
Run Code Online (Sandbox Code Playgroud)
SomeDto:
type: object
properties:
foo:
$ref: '#/components/schema/Foo'
Run Code Online (Sandbox Code Playgroud)
dependencies部分)中。更新如果它仍然不起作用,请尝试按如下方式引用您的课程:
SomeDto:
type: object
properties:
foo:
$ref: 'Foo'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5672 次 |
| 最近记录: |