API 蓝图文件中的 Include 是什么意思?

What does Include mean in API Blueprint files?

我在 API 蓝图规范中看不到它的任何提及,尽管有一个功能请求添加一个 include 指令以包含其他文件。

Include 不要与用于包含其他文件的同名非标准指令混淆(尽管 API Blueprint 的 aglio 工具确实支持后者) .

Includethe MSON specification 中定义,API 蓝图规范引用了它。例如,在 API 蓝图文件的数据结构部分,其中定义的命名类型是使用 MSON 定义的。

Include 就像 Java 中的 extends - 它使当前正在定义的类型继承指定 "supertype" 的所有字段。关键字 Include 后面可能跟一个命名类型的名称(它的通常用法),或者有点奇怪,跟一个内联类型定义:

MSON defines a Mixin Type that supports multiple inheritance from another Named Type. The Named Type being inherited MUST be a Structure Type or its sub-type.

Nested Member Types defined in and inherited from the mixed-in Named Type are added at the same indentation level of the Mixin Type.

Mixin Type → - Include Type Name | - Include Type Definition