我目前正在尝试在Plans
顶级文件夹中创建一个名为"NET 文件夹"的文件夹。使用我的方法,程序崩溃并显示输出:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
下面的代码是我目前使用的代码:
CreateFolderDataRelationshipsParentData createFolderRelationshipsParentData = new CreateFolderDataRelationshipsParentData(
"folders",
parentFolderId);
CreateFolderDataRelationshipsParent createFolderDataRelationshipsParent = new CreateFolderDataRelationshipsParent(createFolderRelationshipsParentData);
CreateFolderDataRelationships createFolderDataFolderRelationships = new CreateFolderDataRelationships(createFolderDataRelationshipsParent);
BaseAttributesExtensionObjectWithoutSchemaLink baseAttribute = new BaseAttributesExtensionObjectWithoutSchemaLink(
"folders:autodesk.bim360:Folder",
"1.0",
folderInfo.Value.attributes.extension.data);
CreateFolderDataAttributes createFolderDataAttributes = new CreateFolderDataAttributes("NET Folder", baseAttribute);
CreateFolderData createFolderData = new CreateFolderData(createFolderDataAttributes, createFolderDataFolderRelationships);
CreateFolder createFolder = new CreateFolder(new JsonApiVersionJsonapi(JsonApiVersionJsonapi.VersionEnum._0), createFolderData);
folderApi.PostFolder(projectId, createFolder);
创建名为"NET 文件夹"的文件夹是否缺少什么?
问题是我在BaseAttributesExtensionObjectWithoutSchemaLink
中使用了错误的对象主体。我没有使用folderInfo.Value.attributes.extension.data
,而是用folder.data
替换了它,然后它就可以工作了。