@fanfare-io/fanfare-sdk-contracts 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,16 @@ npm install @fanfare-io/fanfare-sdk-contracts
17
17
  - [Website](https://www.fanfare.io)
18
18
  - [Source & issues](https://github.com/fanfare-io/fanfare-sdk)
19
19
 
20
+ ## Response schema compatibility
21
+
22
+ Choose the Valibot object mode based on the compatibility contract of the payload:
23
+
24
+ - `v.strictObject` rejects unknown keys. Use it only for deliberately closed contracts, and document why additive server fields must be rejected.
25
+ - `v.object` validates known fields and strips unknown keys. Use it when callers should remain compatible with additive fields but should not receive them.
26
+ - `v.looseObject` validates known fields and preserves unknown keys. Use it when forward-compatible fields must survive validation.
27
+
28
+ This choice is made per endpoint and may differ between a response root and its nested objects. SDK response parsing validates server payloads at runtime, so tightening a nested object can turn an otherwise additive server change into a client-visible validation failure. Treat such changes as coordinated contract changes rather than incidental schema cleanup.
29
+
20
30
  ## License
21
31
 
22
32
  [Apache-2.0](./LICENSE)