Closed rasmusjp closed 5 years ago
On the naming: the generel idea is to be consistent with the Content Delivery and Content Management naming in the APIs. It will be confusing if we call the rest APIs Content Delivery and then start using Published Content in the SDKs. There is also some quirks around calling Media published as lts not really published.
So let's try to avoid using "Published" beyond property values.
I agree, but I couldn't get it working with refit since the files it generates included both namespaces and then it wouldn't compile. I couldn't find a way to configure how the code was generated which is why I renamed the classes
Also the reason for PublishedMedia
was just to follow the naming in Core
Which namespaces or objects were in conflict? Happy to take a look. The rest of the refactor looks really good, so would be great to keep as much of that as possible.
Pushed a new commit where I've removed the Published
prefix, but it won't compile
These are some of the errors I'm getting:
RefitStubs.g.cs(44, 59): [CS0535] 'AutoGeneratedContentDeliveryEndpoints' does not implement interface member 'ContentDeliveryEndpoints.GetAncestors(string, string, Guid)'
RefitStubs.g.cs(58, 26): [CS0104] 'Content' is an ambiguous reference between 'Umbraco.Headless.Client.Net.Management.Models.Content' and 'Umbraco.Headless.Client.Net.Delivery.Models.Content'
Looking at the generated RefitStubs.g.cs
it adds
using Umbraco.Headless.Client.Net.Delivery.Models;
using Umbraco.Headless.Client.Net.Shared.Models;
using Umbraco.Headless.Client.Net.Management.Models;
to the top of the file which is why the objects collide
If we could simply get Refit to put the using statements inside the namespace it wouldn't be an issue. But can't find any references that mentions whether this should be possible.
For now I have removed the use of the Umbraco.Headless.Client.Net.Delivery.Models
in ContentDeliveryEndpoints
, which solves the ambigious reference issue.
Made a few minor corrections here and there, but all in all looks good. Seems like this library is more or less done, so on to the samples 😄
Added content management services, I've also done some general refactoring and renamed content delivery
Content
andMedia
toPublishedContent
andPublishedMedia
since they were colliding with the content management ones in the code generated by refit.I've created a new task for handling file uploads