【发布时间】:2018-09-16 05:31:25
【问题描述】:
我正在运行 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,但我不确定如何在其上设置持续时间属性(可能是文本)。 也许我混淆了如何使用/定义没有自身属性的类型 - 有没有办法告诉架构“这只是一个单一的文本值”?
【问题讨论】:
标签: php symfony schema.org api-platform.com