microsoft/kiota-serialization-text
PHP library for Kiota-generated projects that serializes and deserializes text/plain content types. Add it to your generated API client with Composer: microsoft/kiota-serialization-text.
Architecture fit
microsoft/kiota-serialization-text is not an HTTP client, not a Laravel integration, and not a general-purpose text parser. It is a single-responsibility plugin that implements Kiota's SerializationWriter/ParseNode abstractions for text/plain content types. Its entire job is to slot into the serialization registry of a Kiota-generated client.Illuminate\Support\Facades\Http, or Saloon, this package delivers zero functional benefit and adds a dependency.microsoft/kiota-serialization-json, -multipart, -form). If we adopt Kiota, this is one of several providers registered at client construction — it is not a load-bearing architectural choice, it is a config-line choice. That materially lowers both risk and upside.text/plain responses are typically a raw string. The provider's practical behaviour is to read/write scalar strings and reject structured object graphs. It matters only for endpoints in our consumed API surface that genuinely return text/plain (e.g., export/download endpoints, log or report payloads, a few Graph content endpoints). If no consumed endpoint returns text/plain, adopting this package is dead weight.text/plain response. That is a narrow, discoverable, late-binding failure — not a systemic one. It will surface in integration testing, not silently in production.Integration feasibility
composer require microsoft/kiota-serialization-text — trivial, MIT licensed, no native extensions, no system dependencies.microsoft/kiota-abstractions and is version-synchronised to the Kiota PHP monorepo. Since 1.5.0 the maintainers explicitly state that all Kiota core libraries move in lockstep, so this package cannot be upgraded independently of the abstractions package and the generated client. This is the primary integration constraint, not the install.ParseNode/SerializationWriter harness. SonarCloud coverage and a PR-validation workflow are visible in the README, which is a positive signal on quality discipline even if absolute coverage is unverified.Technical risk
kiota-abstractions major bump can force a coordinated upgrade of this package, the JSON provider, and regenerated client code simultaneously. We already saw a breaking PHP-floor change in 2.0.0. Treat minor bumps here as potentially breaking in practice.microsoft/kiota-php. That means our issue triage path is a different repository than the one we depend on, and the changelog entries here are largely "Synchronize versions" chores — the real change history is elsewhere. Our supply-chain and audit tooling must be pointed at the monorepo.text/plain response for one or two endpoints, fixable by falling back to raw-body handling.Key questions
text/plain? Can we name them and point at the generated code path that needs the provider?kiota-abstractions + serialization providers + regenerated client code, and how often do we expect that cycle?text/plain response can be handled by reading the raw response body, is the provider earning its place at all versus a one-line fallback in our HTTP layer?Stack fit
Http usage elsewhere in the app. Both stacks can coexist; the boundary is the Kiota client instance.Migration path
TextSerializationWriterFactory/parse-node factory alongside the JSON provider in the client's serialization registry, then re-run the affected integration tests.Compatibility
composer why microsoft/kiota-abstractions.guzzlehttp/* or psr/http-* constraints; the package should be inert on that axis but confirm in CI.Sequencing
text/plain endpoints actually consumed; if zero, close the assessment.kiota-abstractions alongside it.Maintenance
microsoft/kiota-php, our internal runbook must record the correct upstream URL, otherwise the first incident will be triaged against a repository that does not accept issues.Support
text/plain payload shape causing a deserialization exception. Make sure on-call has a documented workaround (bypass the client, read the raw body, log the payload) so an isolated endpoint failure does not escalate.Scaling
Failure modes
text/plain response received → exception or empty model. Detectable in integration tests; add a smoke test per endpoint.text/plain → the provider treats text as a scalar; if an endpoint returns something structured under a text/plain content type, we will lose data. Log raw bodies for these endpoints during rollout to confirm the assumption.SerializationWriter if Microsoft ever stops publishing it.Ramp-up
text/plain endpoint to justify it; otherwise decline. Do not let it become the reason a Kiota adoption is scoped.How can I help you explore Laravel packages today?