Skip to content

Kontent.Ai.Management 9.0.0-rc.2

Pre-release
Pre-release

Choose a tag to compare

Breaking changes

  • Reference moved from the asset-folder and taxonomy-group PATCH bases onto the operations that need it, where it is required. Both bases declared a nullable Reference, so a remove, rename, move or replace operation 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: required on the ones that target something (AssetFolderRemovePatchModel, AssetFolderRenamePatchModel, TaxonomyGroupRemovePatchModel, TaxonomyGroupMovePatchModel, TaxonomyGroupReplacePatchModel), and still optional on addInto, 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 set Reference on these operations still compiles, and code that did not now fails to compile instead of failing at the API.

Changed

  • EnvironmentId is 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 an EnvironmentId regardless — 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, and EnvironmentId is validated for format only when supplied, exactly as SubscriptionId already 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 404 for 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 an IManagementResult, which is never null — so a failed call passed. Replacing that with EnsureSuccess() 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 CreateRefitSettings wrapper is gone, and the deliberate ScheduleResponseModel date divergence is now recorded so it is not "corrected" later.

  • IntelliSense wording corrections. The single-item custom-app operations described themselves in the plural, UpdatePreviewConfigurationAsync was documented as a "Modify" (this SDK's word for PATCH, 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.Abstractions reference 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 IManagementResult it received, so a failed call passed the test and the published sample taught ignoring the result pattern the SDK is built around. They now use EnsureSuccess(), 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) caught InvalidOperationException and reported it as a missing client — but the registration runs during resolution, so a configureHttpClient that 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.Parse into a DateTimeOffset scheduling 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. ManagementClientBuilder customizes the resilience pipeline; the Refit hook it also advertised is gone.

  • The X-KC-SOURCE header keeps naming the integration that made the call. Attribution matched the SDK assembly by full name, which carries the version — and nothing pins AssemblyVersion, 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 EnvironmentId became optional for subscription-only clients, every environment operation throws InvalidOperationException when 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 in Error.Exception. A consumer following the old text wrote a catch that never fires and skipped the IsSuccess check 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 SubscriptionId in 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 to https://app.kontent.ai/subscription/<subscription-id>/api-keys, which only a subscription admin can use.

Installation

dotnet add package Kontent.Ai.Management --prerelease

Full changelog: src/management/CHANGELOG.md