Skip to content

Conversation

@mathpirate
Copy link
Contributor

@mathpirate mathpirate commented Oct 1, 2025

Summary by cubic

Unwraps OpaqueRef to its inner type during schema generation and marks schemas with asOpaque: true. This makes derive/lift outputs correctly represent opaque values.

  • New Features

    • Unwrap OpaqueRef and add asOpaque: true to the resulting schema.
    • Detect OpaqueRef when it expands to intersection types (OpaqueRefMethods & T).
  • Refactors

    • Unified wrapper handling for Cell, Stream, and OpaqueRef; preserves Stream behavior and the Cell<Stream> guard.
    • getNamedTypeKey now treats OpaqueRef as a wrapper to avoid hoisting inner named types.

Copy link
Contributor

@ubik2 ubik2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. i should make a corresponding change to JSONSchema
Edit: #1854

@mathpirate mathpirate merged commit 83c6e56 into main Oct 1, 2025
7 checks passed
@mathpirate mathpirate deleted the fix/derive-unwrap-opaque-refs branch October 1, 2025 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants