@@ -752,12 +752,21 @@ export function toMultiDocument(document: Document): MultiDocument {
752752 *
753753 * Use when you need JSON Schema output from a representation whose checks carry compiler annotations.
754754 *
755+ * **Details**
756+ *
757+ * For representation documents whose validation semantics can be expressed exactly in JSON Schema, importing the
758+ * emitted document with {@link fromJsonSchemaDocument} reconstructs a schema that accepts the same JSON values. This
759+ * is a semantic round-trip guarantee; the emitted document and reconstructed representation may have different shapes.
760+ *
755761 * **Gotchas**
756762 *
757- * Opaque declarations are represented by an unconstrained JSON Schema. Check callback results are used directly, and
758- * exceptions raised by a callback pass through unchanged. Callbacks must treat their input schemas as immutable. Each
759- * returned value must be a valid JSON Schema object graph and must not be mutated after the callback returns. Local
760- * definition references returned by callbacks are resolved together with compiler-generated references.
763+ * - Opaque declarations are represented by an unconstrained JSON Schema and are outside the exact round-trip subset.
764+ * - Check callback results are used directly, and exceptions raised by a callback pass through unchanged. Callbacks
765+ * must treat their input schemas as immutable. Each returned value must be a valid JSON Schema object graph and must
766+ * not be mutated after the callback returns.
767+ * - Local definition references returned by callbacks are resolved together with compiler-generated references.
768+ * - Effect decoding may discard excess object properties by default. Use `onExcessProperty: "error"` when comparing
769+ * validation semantics with the emitted JSON Schema.
761770 *
762771 * @see {@link toJsonSchemaMultiDocument } for multiple roots sharing definitions
763772 *
@@ -1178,12 +1187,23 @@ export function fromRepresentations(
11781187 *
11791188 * Use when you need to validate or transform values described by an external JSON Schema document.
11801189 *
1190+ * **Details**
1191+ *
1192+ * For the Draft 2020-12 subset translated exactly by this importer, compiling the imported schema through
1193+ * {@link toRepresentation} and {@link toJsonSchemaDocument} produces a document that accepts the same JSON values as
1194+ * the input. This is a semantic round-trip guarantee; keyword layout, definitions, and annotations may be normalized.
1195+ *
11811196 * **Gotchas**
11821197 *
1183- * Import is best-effort. Built-in declarations and checks are reconstructed with importer-owned revivers. Pattern
1184- * constraints reached during translation cause an error by default. Use `patterns: "apply"` only for trusted documents,
1185- * or `patterns: "ignore"` to weaken validation explicitly. Callback results are used directly, and exceptions raised by a
1186- * callback pass through unchanged.
1198+ * - Import is best-effort outside the exactly translated subset. Unsupported or ignored keywords are not covered by the
1199+ * round-trip guarantee.
1200+ * - Built-in declarations and checks are reconstructed with importer-owned revivers.
1201+ * - Pattern constraints reached during translation cause an error by default. Use `patterns: "apply"` only for trusted
1202+ * documents, or `patterns: "ignore"` to weaken validation explicitly; ignored patterns are outside the round-trip
1203+ * guarantee.
1204+ * - `onEnter` results replace the corresponding input nodes, so the round-trip guarantee applies to the rewritten
1205+ * document.
1206+ * - Callback results are used directly, and exceptions raised by a callback pass through unchanged.
11871207 *
11881208 * @see {@link fromJsonSchemaMultiDocument } for multiple roots sharing definitions
11891209 * @see {@link toRepresentation } for converting the result to a representation document
0 commit comments