我正在运行 API 平台模式类型生成器,但在使用 schema.org 中定义但没有自己的属性 ( http://schema.org/Duration ) 的类型时遇到了困难。
当我运行 vendor/bin/schema generate-types 时,我得到
[error] The property "potentialAction" (type "Duration") has an unknown type. Add its type to the config file.
[warning] The property "identifier" (type "Duration") has several types. Using the first one ("URL") or possible options("URL", "Text").
我的类型配置是:
types:
Thing:
properties:
name: ~
Duration: ~
Recipe:
properties:
cookTime: ~
recipeCuisine: ~
如果我定义 Duration 从父级继承的属性之一(例如 Thing->Name),它会生成 OK,但我不确定如何在其上设置持续时间属性(可能是文本)。也许我混淆了如何使用/定义没有自己属性的类型 - 有没有办法告诉模式“这只是一个单一的文本值”?