docs: Document removal of Hash inheritance from response models#458
docs: Document removal of Hash inheritance from response models#458gjtorikian merged 1 commit intonext-majorfrom
Conversation
Adds a "Response models no longer inherit from `Hash`" section to the v7 migration guide, explaining the behavioral differences between v6's `DeprecatedHashWrapper < Hash` models and v7's `HashProvider`-based models. Closes the documentation half of #316. Co-Authored-By: garen.torikian <garen.torikian@workos.com>
Original prompt from garen.torikian
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR adds a "Response models no longer inherit from Confidence Score: 5/5Documentation-only change with accurate content — safe to merge. The PR is a single documentation file change. The described v6/v7 behavioral differences are technically accurate, all relevant migration paths are covered, and no code is modified. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Response Model Instance] --> B{v6 DeprecatedHashWrapper < Hash}
A --> C{v7 include HashProvider}
B --> B1["is_a?(Hash) → true"]
B --> B2["to_hash → self (DirectoryUser)"]
B --> B3["to_h → JSON string"]
B --> B4["user[:id] → value (with deprecation warning)"]
B --> B5["**splat / Hash#merge → implicit to_hash coercion"]
C --> C1["is_a?(Hash) → false"]
C --> C2["to_hash → NoMethodError"]
C --> C3["to_h → real Hash"]
C --> C4["user[:id] → NoMethodError"]
C --> C5["**user.to_h / merge(user.to_h) → explicit conversion needed"]
C --> C6["to_json → JSON string"]
Reviews (1): Last reviewed commit: "Document removal of Hash inheritance fro..." | Re-trigger Greptile |
Description
Adds a "Response models no longer inherit from
Hash" section todocs/V7_MIGRATION_GUIDE.mdexplaining the behavioral differences between v6'sDeprecatedHashWrapper < Hashmodels and v7'sHashProvider-based models.Covers:
is_a?(Hash)is nowfalsefor response models.to_hashis removed; useto_h.to_hnow returns a real Hash (v6 returned a JSON string).user[:attr]Hash-style access is removed; use the accessor (user.attr).**splat/Hash#mergecall sites that relied on the implicitto_hashcoercion contract.Closes the documentation half of #316. The v7 code change that removed the
Hashinheritance is already on this branch via #457.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
Link to Devin session: https://app.devin.ai/sessions/f4878ca282304edc9d70b5846ecdad79