[V14] Allow specifying ID on the create package endpoint (#16203)

* Allow package creation to specify the ID

* update openapi

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
This commit is contained in:
Sven Geusens
2024-05-02 11:33:15 +02:00
committed by GitHub
parent 0cfa8626b1
commit 2009989f6a
3 changed files with 8 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ internal class PackagePresentationFactory : IPackagePresentationFactory
// Temp Id, PackageId and PackagePath for the newly created package
packageDefinition.Id = 0;
packageDefinition.PackageId = Guid.Empty;
packageDefinition.PackageId = createPackageRequestModel.Id ?? Guid.Empty;
packageDefinition.PackagePath = string.Empty;
return packageDefinition;

View File

@@ -33936,6 +33936,11 @@
"items": {
"type": "string"
}
},
"id": {
"type": "string",
"format": "uuid",
"nullable": true
}
},
"additionalProperties": false
@@ -43991,4 +43996,4 @@
}
}
}
}
}

View File

@@ -2,4 +2,5 @@ namespace Umbraco.Cms.Api.Management.ViewModels.Package;
public class CreatePackageRequestModel : PackageModelBase
{
public Guid? Id { get; set; }
}