Kontent.Ai.Management 9.0.0-rc.2
Pre-releaseBreaking changes
Referencemoved from the asset-folder and taxonomy-group PATCH bases onto the operations that need it, where it isrequired. Both bases declared a nullableReference, so aremove,rename,moveorreplaceoperation could be constructed without the reference the API demands — the compiler was fine with it and the request failed at the server. Each operation now declares its own:requiredon the ones that target something (AssetFolderRemovePatchModel,AssetFolderRenamePatchModel,TaxonomyGroupRemovePatchModel,TaxonomyGroupMovePatchModel,TaxonomyGroupReplacePatchModel), and still optional onaddInto, where it names the parent to add into and its absence means the root. This matches the collection patch models, which were already shaped this way. The wire format is unchanged; code that already setReferenceon these operations still compiles, and code that did not now fails to compile instead of failing at the API.
Changed
-
EnvironmentIdis no longer required when you only call subscription endpoints. Subscription-scoped endpoints resolve against/v2/subscriptions/{id}and never touch an environment, but validation demanded anEnvironmentIdregardless — so a subscription admin listing projects had to invent an environment GUID the SDK would never use. Each scope's client is now built only when its identifier is configured, andEnvironmentIdis validated for format only when supplied, exactly asSubscriptionIdalready was.Calling into a scope you did not configure fails immediately, naming the option — before the request is built, so you never see the API's
404for a path with an empty segment:EnvironmentId is not configured. Set ManagementOptions.EnvironmentId to call environment endpoints.Configuring neither identifier is still rejected at registration: that client could call nothing at all. Every existing configuration behaves exactly as before — this only accepts input that was previously refused.
Fixed
-
The doc samples assert success rather than that a result object exists. Forty of them ended in
Assert.NotNull(response)against anIManagementResult, which is never null — so a failed call passed. Replacing that withEnsureSuccess()immediately surfaced five sample fixtures that had drifted out of step with their models and could no longer deserialize; those are refreshed from the fixtures the domain tests use. -
The pass-through
CreateRefitSettingswrapper is gone, and the deliberateScheduleResponseModeldate divergence is now recorded so it is not "corrected" later. -
IntelliSense wording corrections. The single-item custom-app operations described themselves in the plural,
UpdatePreviewConfigurationAsyncwas documented as a "Modify" (this SDK's word forPATCH, which it is not) with a parameter described as project-scoped, and a subscription-user method read "Retrieve a user metadata". Two enum members had typos in their summaries. -
The unused
Microsoft.Extensions.Logging.Abstractionsreference is gone, so it no longer lands in the published package as a dependency nobody needs. -
The doc samples for importing content check their results. Every one of the nineteen discarded the
IManagementResultit received, so a failed call passed the test and the published sample taught ignoring the result pattern the SDK is built around. They now useEnsureSuccess(), which is both a real assertion and the idiomatic sample code — and each sample is backed by a response fixture that actually deserializes, so the assertion has something to check rather than passing on an empty body. -
The client factory no longer relabels an exception that came from your own registration.
Get(name)caughtInvalidOperationExceptionand reported it as a missing client — but the registration runs during resolution, so aconfigureHttpClientthat rejected its input came back as "No management client registered with name '…'", pointing at the wrong thing entirely. A genuinely missing registration still says so. -
A doc sample no longer reads a bare timestamp in the machine's time zone. Three samples fed
DateTime.Parseinto aDateTimeOffsetscheduling parameter, which is exactly the ambiguity the SDK's date convention exists to prevent — taught in code people copy. They now construct the offset explicitly, as the README sample already did. -
The README no longer offers a Refit-settings hook that was removed.
ManagementClientBuildercustomizes the resilience pipeline; the Refit hook it also advertised is gone. -
The
X-KC-SOURCEheader keeps naming the integration that made the call. Attribution matched the SDK assembly by full name, which carries the version — and nothing pinsAssemblyVersion, so the reference an integration recorded when it was built stopped matching on the first SDK release after that. The header then went silently missing for every consumer who had not rebuilt. Matching is now by simple name. -
The interface says what happens when you call into a scope you did not configure. Since
EnvironmentIdbecame optional for subscription-only clients, every environment operation throwsInvalidOperationExceptionwhen it is missing — the same guard the subscription operations already documented, but stated nowhere for the ~80 methods on the other side.IManagementClient's own remarks now describe both scopes and the guard once, rather than repeating an<exception>tag on every method. -
The documented error-handling model matches what the SDK does. The README, the upgrade guide and the
IManagementResult/ typed-variant IntelliSense all said network-level and serialization failures "still propagate as exceptions". They do not, and have not since the result pattern landed: a transport failure that never reached the server and a response whose body could not be read are both failed results, carrying the exception inError.Exception. A consumer following the old text wrote acatchthat never fires and skipped theIsSuccesscheck that would have caught the failure. The docs now state what actually throws — cancellation, argument and configuration validation,EnsureSuccess(), and a typed-variant projection onto a record that no longer matches the content type — and the behaviour is pinned by tests. -
The README now says how to configure a subscription-scoped call. It listed
SubscriptionIdin the options table and mentioned "an API key with subscription scope", but never said the Subscription API key is a different credential from the Management API key or where to get one. There is now a worked example and a pointer tohttps://app.kontent.ai/subscription/<subscription-id>/api-keys, which only a subscription admin can use.
Installation
dotnet add package Kontent.Ai.Management --prereleaseFull changelog: src/management/CHANGELOG.md