问题描述
我无法使用.NET Contentful SDK 5.0.0在RTF文本字段中创建嵌入式条目。
var entry = new Block()
{
NodeType = "embedded-entry-block",Data = new BlockData()
{
Target = new Contentful.Core.Models.Management.ReferenceProperties()
{
LinkType = "Entry",Id = "2eUs1oo4fV4CuMgi57tycX"
}
}
};
根据Contentful Api Documentation,Block应该具有BlockData类型的Data属性。 BlockData具有Target属性,该属性应为ReferenceProperties类型。这些ReferenceProperty应该具有LinkType和ID,如您在上面的代码中看到的那样,该ID已提供。
但是当我尝试运行代码时,它会抛出:
Validation error[
{
"name": "unexpected","details": "The property \"type\" is not expected","path": [
"fields","text","de","content","data","target","type"
]
},{
"name": "unexpected","details": "The property \"linkType\" is not expected","linkType"
]
},"details": "The property \"id\" is not expected","id"
]
},{
"name": "required","details": "The property \"sys\" is required here","sys"
]
},"details": "The property \"content\" is required here","content"
]
}
]
我错过了什么吗?为此,Block绝对是正确的课程吗?
我也在EntryStructure类上尝试过,但是没有用。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)