如何解决在内容丰富文本中创建嵌入式块条目
我无法使用.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 举报,一经查实,本站将立刻删除。