diff --git a/Cargo.lock b/Cargo.lock
index 0317b77037a..d24d0a9c9ed 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10860,6 +10860,18 @@ dependencies = [
"syn 2.0.118",
]
+[[package]]
+name = "problematic"
+version = "0.0.0"
+dependencies = [
+ "http 1.4.2",
+ "insta",
+ "schemars 1.2.1",
+ "serde",
+ "serde_core",
+ "serde_json",
+]
+
[[package]]
name = "proc-macro-crate"
version = "3.5.0"
diff --git a/Cargo.toml b/Cargo.toml
index 99d1307bd39..5c7020db71b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -47,6 +47,7 @@ members = [
"libs/darwin-kperf/sys",
"libs/error-stack",
"libs/error-stack/macros",
+ "libs/problematic/rust",
"tests/graph/benches",
"tests/graph/integration",
"tests/graph/test-data/rust",
@@ -106,6 +107,7 @@ hashql-hir.path = "libs/@local/hashql/hir"
hashql-macros.path = "libs/@local/hashql/macros"
hashql-mir.path = "libs/@local/hashql/mir"
hashql-syntax-jexpr.path = "libs/@local/hashql/syntax-jexpr"
+problematic.path = "libs/problematic/rust"
type-system.path = "libs/@blockprotocol/type-system/rust"
# External dependencies
@@ -185,7 +187,7 @@ hifijson = { version = "0.4.0", default-features = fal
hkdf = { version = "0.13.0", default-features = false }
hmac = { version = "0.13.0", default-features = false }
hostname = { version = "0.4.2", default-features = false }
-http = { version = "1.3.1", default-features = false }
+http = { version = "1.3.1", default-features = false, features = ["std"] }
humansize = { version = "2.1.3", default-features = false }
hyper = { version = "1.7.0", default-features = false }
include_dir = { version = "0.7.4", default-features = false }
diff --git a/libs/@local/graph/authentication/Cargo.toml b/libs/@local/graph/authentication/Cargo.toml
index 31a24439a9c..4d41287fee5 100644
--- a/libs/@local/graph/authentication/Cargo.toml
+++ b/libs/@local/graph/authentication/Cargo.toml
@@ -15,7 +15,7 @@ hash-middleware = { workspace = true, public = true }
type-system = { workspace = true, public = true }
# Public third-party dependencies
-http = { workspace = true, public = true, features = ["std"] }
+http = { workspace = true, public = true }
jsonwebtoken = { workspace = true, public = true, features = ["aws_lc_rs"] }
opentelemetry = { workspace = true, public = true, features = ["metrics"] }
reqwest = { workspace = true, public = true }
diff --git a/libs/@local/middleware/Cargo.toml b/libs/@local/middleware/Cargo.toml
index c1c9e2939cc..f0e76571b3b 100644
--- a/libs/@local/middleware/Cargo.toml
+++ b/libs/@local/middleware/Cargo.toml
@@ -14,7 +14,7 @@ type-system = { workspace = true, public = true }
# Public third-party dependencies
axum = { workspace = true, public = true }
axum-core = { workspace = true, public = true }
-http = { workspace = true, public = true, features = ["std"] }
+http = { workspace = true, public = true }
opentelemetry = { workspace = true, public = true, features = ["metrics"] }
tower-layer = { workspace = true, public = true }
tower-service = { workspace = true, public = true }
diff --git a/libs/problematic/rust/CHANGELOG.md b/libs/problematic/rust/CHANGELOG.md
new file mode 100644
index 00000000000..06730371150
--- /dev/null
+++ b/libs/problematic/rust/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Change Log
+
+## 0.1.0 - Unreleased
+
+- Initial release
diff --git a/libs/problematic/rust/Cargo.toml b/libs/problematic/rust/Cargo.toml
new file mode 100644
index 00000000000..f1c8f048506
--- /dev/null
+++ b/libs/problematic/rust/Cargo.toml
@@ -0,0 +1,53 @@
+[package]
+name = "problematic"
+version = "0.0.0"
+authors.workspace = true
+edition.workspace = true
+description = "HTTP Problem Details with typed extensions and JSON Schema support"
+license = "MIT OR Apache-2.0"
+documentation = "https://docs.rs/problematic"
+repository = "https://github.com/hashintel/hash/tree/main/libs/problematic/rust"
+exclude = ["package.json", "turbo.json", "docs/task-dependencies.json"]
+
+[dependencies]
+# Public workspace dependencies
+
+# Public third-party dependencies
+http = { workspace = true, public = true }
+
+# Public third-party dependencies (optional)
+schemars = { workspace = true, public = true, optional = true }
+serde_core = { workspace = true, public = true, optional = true }
+
+# Private workspace dependencies
+
+# Private third-party dependencies
+serde = { workspace = true, optional = true, features = ["alloc", "derive"] }
+
+[dev-dependencies]
+insta = { workspace = true, features = ["json"] }
+serde_json = { workspace = true, features = ["arbitrary_precision"] }
+
+[[test]]
+name = "extensions"
+required-features = ["serde"]
+
+[[test]]
+name = "problem_details"
+required-features = ["serde"]
+
+[[test]]
+name = "schema"
+required-features = ["schemars"]
+
+[features]
+schemars = ["dep:schemars"]
+serde = ["dep:serde_core", "dep:serde"]
+
+[lints]
+workspace = true
+
+[package.metadata.docs.rs]
+all-features = true
+cargo-args = ["-Z", "unstable-options", "-Z", "rustdoc-scrape-examples"]
+targets = ["x86_64-unknown-linux-gnu"]
diff --git a/libs/problematic/rust/LICENSE-APACHE.md b/libs/problematic/rust/LICENSE-APACHE.md
new file mode 100644
index 00000000000..1d1b6f8da4d
--- /dev/null
+++ b/libs/problematic/rust/LICENSE-APACHE.md
@@ -0,0 +1,189 @@
+# Apache License
+
+_Version 2.0, January 2004_
+_<>_
+
+### Terms and Conditions for use, reproduction, and distribution
+
+#### 1. Definitions
+
+“License” shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+“Licensor” shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+“Legal Entity” shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, “control” means **(i)** the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
+outstanding shares, or **(iii)** beneficial ownership of such entity.
+
+“You” (or “Your”) shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+“Source” form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+“Object” form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+“Work” shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+“Derivative Works” shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+“Contribution” shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+“submitted” means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as “Not a Contribution.”
+
+“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+#### 2. Grant of Copyright License
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+#### 3. Grant of Patent License
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+#### 4. Redistribution
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+- **(a)** You must give any other recipients of the Work or Derivative Works a copy of
+ this License; and
+- **(b)** You must cause any modified files to carry prominent notices stating that You
+ changed the files; and
+- **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
+ all copyright, patent, trademark, and attribution notices from the Source form
+ of the Work, excluding those notices that do not pertain to any part of the
+ Derivative Works; and
+- **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
+ Derivative Works that You distribute must include a readable copy of the
+ attribution notices contained within such NOTICE file, excluding those notices
+ that do not pertain to any part of the Derivative Works, in at least one of the
+ following places: within a NOTICE text file distributed as part of the
+ Derivative Works; within the Source form or documentation, if provided along
+ with the Derivative Works; or, within a display generated by the Derivative
+ Works, if and wherever such third-party notices normally appear. The contents of
+ the NOTICE file are for informational purposes only and do not modify the
+ License. You may add Your own attribution notices within Derivative Works that
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
+ provided that such additional attribution notices cannot be construed as
+ modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+#### 5. Submission of Contributions
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted
+for inclusion in the Work by You to the Licensor shall be under the terms and
+conditions of this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify the terms of
+any separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+#### 6. Trademarks
+
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+#### 7. Disclaimer of Warranty
+
+Unless required by applicable law or agreed to in writing, Licensor provides the
+Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
+including, without limitation, any warranties or conditions of TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
+solely responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your exercise of
+permissions under this License.
+
+#### 8. Limitation of Liability
+
+In no event and under no legal theory, whether in tort (including negligence),
+contract, or otherwise, unless required by applicable law (such as deliberate
+and grossly negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special, incidental,
+or consequential damages of any character arising as a result of this License or
+out of the use or inability to use the Work (including but not limited to
+damages for loss of goodwill, work stoppage, computer failure or malfunction, or
+any and all other commercial damages or losses), even if such Contributor has
+been advised of the possibility of such damages.
+
+#### 9. Accepting Warranty or Additional Liability
+
+While redistributing the Work or Derivative Works thereof, You may choose to
+offer, and charge a fee for, acceptance of support, warranty, indemnity, or
+other liability obligations and/or rights consistent with this License. However,
+in accepting such obligations, You may act only on Your own behalf and on Your
+sole responsibility, not on behalf of any other Contributor, and only if You
+agree to indemnify, defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason of your
+accepting any such warranty or additional liability.
+
+_END OF TERMS AND CONDITIONS_
+
+### APPENDIX: Apply the Apache License to a specific file
+
+To apply the Apache License to an individual file, attach the following notice.
+The text should be enclosed in the appropriate comment syntax for the file
+format.
+
+ Copyright © 2022–, HASH
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/libs/problematic/rust/LICENSE-MIT.md b/libs/problematic/rust/LICENSE-MIT.md
new file mode 100644
index 00000000000..e33c1d34b0e
--- /dev/null
+++ b/libs/problematic/rust/LICENSE-MIT.md
@@ -0,0 +1,21 @@
+# MIT License
+
+Copyright © 2022–, HASH
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/libs/problematic/rust/LICENSE.md b/libs/problematic/rust/LICENSE.md
new file mode 100644
index 00000000000..8b31346dd55
--- /dev/null
+++ b/libs/problematic/rust/LICENSE.md
@@ -0,0 +1,5 @@
+# License
+
+Licensed under either of the [Apache License, Version 2.0](LICENSE-APACHE.md) or [MIT license](LICENSE-MIT.md) at your option.
+
+For more information about contributing to this crate, see our top-level [CONTRIBUTING](https://github.com/hashintel/hash/blob/main/.github/CONTRIBUTING.md) policy.
diff --git a/libs/problematic/rust/README.md b/libs/problematic/rust/README.md
new file mode 100644
index 00000000000..bac9a0b80ef
--- /dev/null
+++ b/libs/problematic/rust/README.md
@@ -0,0 +1,22 @@
+# problematic
+
+HTTP Problem Details with typed extension members.
+
+## Features
+
+- `serde` enables serialization and deserialization, including borrowing strings from the input.
+- `schemars` enables JSON Schema generation independently of `serde`.
+
+No features are enabled by default.
+
+## Contributors
+
+[HASH](https://hash.dev/) created and maintains `problematic`. Contributions are welcome. Follow the [contributing guide](https://github.com/hashintel/hash/blob/main/.github/CONTRIBUTING.md) to contribute. Ask questions in [GitHub Discussions](https://github.com/orgs/hashintel/discussions).
+
+## License
+
+`problematic` is available under either of the [Apache License, Version 2.0] or [MIT license] at your option. Please see the [LICENSE] file for more information.
+
+[Apache License, Version 2.0]: LICENSE-APACHE.md
+[MIT license]: LICENSE-MIT.md
+[LICENSE]: LICENSE.md
diff --git a/libs/problematic/rust/docs/task-dependencies.json b/libs/problematic/rust/docs/task-dependencies.json
new file mode 100644
index 00000000000..df0316a8f2c
--- /dev/null
+++ b/libs/problematic/rust/docs/task-dependencies.json
@@ -0,0 +1,18 @@
+{
+ "package": "@rust/problematic",
+ "dependencies": [],
+ "tasks": {
+ "lint:clippy": {
+ "dependsOn": [],
+ "env": [
+ "GITHUB_EVENT_NAME"
+ ]
+ },
+ "test:unit": {
+ "dependsOn": [],
+ "env": [
+ "TEST_COVERAGE"
+ ]
+ }
+ }
+}
diff --git a/libs/problematic/rust/package.json b/libs/problematic/rust/package.json
new file mode 100644
index 00000000000..718c1913083
--- /dev/null
+++ b/libs/problematic/rust/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "@rust/problematic",
+ "version": "0.0.0",
+ "private": true,
+ "description": "HTTP Problem Details with typed extensions and JSON Schema support",
+ "license": "MIT OR Apache-2.0",
+ "scripts": {
+ "lint:clippy": "just clippy",
+ "test:unit": "mise run test:unit @rust/problematic"
+ }
+}
diff --git a/libs/problematic/rust/src/lib.rs b/libs/problematic/rust/src/lib.rs
new file mode 100644
index 00000000000..add395312c3
--- /dev/null
+++ b/libs/problematic/rust/src/lib.rs
@@ -0,0 +1,23 @@
+//! HTTP Problem Details with typed extension members.
+//!
+//! [`ProblemType`] describes a problem's shared metadata. [`ProblemDetails`] represents an
+//! occurrence as a JSON object, with extension members alongside the standard fields.
+//!
+//! The optional `serde` feature enables serialization and deserialization. The `schemars` feature
+//! independently adds JSON Schema support to [`ProblemDetails`] and [`NoExtensions`].
+
+#![cfg_attr(doc, feature(doc_cfg))]
+
+extern crate alloc;
+
+mod problem_details;
+mod problem_type;
+#[cfg(feature = "serde")]
+mod serde;
+
+pub use http::StatusCode;
+
+pub use self::{
+ problem_details::{NoExtensions, ProblemDetails},
+ problem_type::ProblemType,
+};
diff --git a/libs/problematic/rust/src/problem_details.rs b/libs/problematic/rust/src/problem_details.rs
new file mode 100644
index 00000000000..872b2e16877
--- /dev/null
+++ b/libs/problematic/rust/src/problem_details.rs
@@ -0,0 +1,118 @@
+use alloc::borrow::Cow;
+
+#[cfg(feature = "serde")]
+use ::serde::{Deserialize, Serialize};
+
+#[cfg(feature = "serde")]
+use crate::serde::{deserialize_optional_cow, serialize_extensions};
+
+/// An empty object for problem types without extensions.
+#[derive(Debug, Clone, Copy)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
+#[expect(
+ clippy::empty_structs_with_brackets,
+ reason = "The empty struct must serialize as an object."
+)]
+pub struct NoExtensions {}
+
+#[cfg(any(feature = "serde", feature = "schemars"))]
+const fn default_type_uri() -> Cow<'static, str> {
+ Cow::Borrowed("about:blank")
+}
+
+/// An RFC 9457 problem details object with problem-specific extension members.
+///
+/// Serialization includes `type`, `title`, and `status`, plus `detail` and `instance` when
+/// supplied.
+#[derive(Debug, Clone)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(
+ feature = "schemars",
+ derive(schemars::JsonSchema),
+ schemars(title = "Problem Details")
+)]
+pub struct ProblemDetails<'a, E> {
+ /// A URI reference identifying the problem type. Use `about:blank` when the HTTP status code
+ /// fully describes the problem type. If `type` is omitted during deserialization, it defaults
+ /// to `about:blank`.
+ #[cfg_attr(
+ any(feature = "serde", feature = "schemars"),
+ serde(rename = "type", borrow, default = "default_type_uri")
+ )]
+ #[cfg_attr(
+ feature = "schemars",
+ schemars(
+ extend("format" = "uri-reference"),
+ example = "https://example.com/problems/wrong-actor-type"
+ )
+ )]
+ pub type_uri: Cow<'a, str>,
+
+ /// A short, human-readable summary of the problem type. Keep it the same across occurrences,
+ /// except for localization.
+ #[cfg_attr(any(feature = "serde", feature = "schemars"), serde(borrow))]
+ #[cfg_attr(feature = "schemars", schemars(example = "Wrong actor type"))]
+ pub title: Cow<'a, str>,
+
+ /// The HTTP status code sent with this occurrence.
+ #[cfg_attr(
+ feature = "schemars",
+ schemars(range(min = 100, max = 599), example = 403)
+ )]
+ pub status: u16,
+
+ /// A human-readable explanation of this occurrence that helps the client correct the problem.
+ /// Use extension members for structured information.
+ #[cfg_attr(
+ any(feature = "serde", feature = "schemars"),
+ serde(
+ borrow,
+ default,
+ skip_serializing_if = "Option::is_none",
+ deserialize_with = "deserialize_optional_cow"
+ )
+ )]
+ #[cfg_attr(
+ feature = "schemars",
+ schemars(required, example = "This operation requires a machine actor.")
+ )]
+ pub detail: Option>,
+
+ /// A URI reference identifying this occurrence. It may identify the occurrence without
+ /// resolving to further information.
+ #[cfg_attr(
+ any(feature = "serde", feature = "schemars"),
+ serde(
+ borrow,
+ default,
+ skip_serializing_if = "Option::is_none",
+ deserialize_with = "deserialize_optional_cow"
+ )
+ )]
+ #[cfg_attr(
+ feature = "schemars",
+ schemars(
+ required,
+ extend("format" = "uri-reference"),
+ example = "https://example.com/problem-occurrences/42"
+ )
+ )]
+ pub instance: Option>,
+
+ /// Problem-specific members included alongside the standard fields.
+ ///
+ /// Serialization fails for non-object values or top-level members named `type`, `title`,
+ /// `status`, `detail`, or `instance`. Nested members may use these names. Errors from the
+ /// extension serializer propagate. The extension type must support Serde flattening for
+ /// deserialization.
+ #[cfg_attr(
+ any(feature = "serde", feature = "schemars"),
+ serde(
+ flatten,
+ serialize_with = "serialize_extensions",
+ bound(serialize = "E: Serialize")
+ )
+ )]
+ pub extensions: E,
+}
diff --git a/libs/problematic/rust/src/problem_type.rs b/libs/problematic/rust/src/problem_type.rs
new file mode 100644
index 00000000000..a4a405a37d0
--- /dev/null
+++ b/libs/problematic/rust/src/problem_type.rs
@@ -0,0 +1,26 @@
+use alloc::borrow::Cow;
+
+use crate::StatusCode;
+
+/// Metadata shared by occurrences of a problem type.
+///
+/// ```
+/// use std::borrow::Cow;
+///
+/// use problematic::{ProblemType, StatusCode};
+///
+/// const WRONG_ACTOR_TYPE: ProblemType = ProblemType {
+/// type_uri: Cow::Borrowed("https://example.com/problems/wrong-actor-type"),
+/// title: Cow::Borrowed("Wrong actor type"),
+/// status: StatusCode::FORBIDDEN,
+/// };
+/// ```
+#[derive(Debug)]
+pub struct ProblemType {
+ /// The stable URI identifying this problem type.
+ pub type_uri: Cow<'static, str>,
+ /// The title shared by occurrences of this problem type.
+ pub title: Cow<'static, str>,
+ /// The HTTP status code for occurrences of this problem type.
+ pub status: StatusCode,
+}
diff --git a/libs/problematic/rust/src/serde/mod.rs b/libs/problematic/rust/src/serde/mod.rs
new file mode 100644
index 00000000000..0e75fd9b3b1
--- /dev/null
+++ b/libs/problematic/rust/src/serde/mod.rs
@@ -0,0 +1,23 @@
+use alloc::borrow::Cow;
+
+use serde::{Deserialize, Deserializer};
+
+mod serialization;
+
+pub(crate) use self::serialization::serialize_extensions;
+
+// Serde enables borrowing for a direct Cow field, but not for Cow nested inside Option.
+#[derive(Deserialize)]
+#[serde(transparent)]
+struct BorrowCow<'a>(#[serde(borrow)] Cow<'a, str>);
+
+/// Borrows optional strings when the deserializer can lend them.
+///
+/// # Errors
+///
+/// Returns the deserializer's error if the value is neither a string nor null.
+pub(crate) fn deserialize_optional_cow<'de: 'a, 'a, D: Deserializer<'de>>(
+ deserializer: D,
+) -> Result