Skip to content

docs: add multi-language response type examples - #191

Merged
adamcavendish merged 1 commit into
mainfrom
adamcavendish/response-type-examples
Oct 19, 2026
Merged

adamcavendish merged 1 commit into
mainfrom
adamcavendish/response-type-examples

Conversation

@adamcavendish

@adamcavendish adamcavendish commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add cargo run --example response_types to compare response field representations using existing APIs:

Target Representation
TypeScript Singleton-key Record intersections and Partial
Go Alias for an anonymous struct
Dart 3 Named record
Swift Labelled tuple
Python Named TypedDict with NotRequired
Rust Named struct
Kotlin Named data class

The example prints all generated sources or writes them to a supplied directory. Focused tests protect TypeScript import aliases and optional-key composition, native fragment syntax, and named declarations. Run instructions live in the example itself, and the smoke suite runs it.

Boundaries

  • No public API, lowering behavior, version, release metadata, or downstream consumer changes.
  • These are target-associated examples, not interchangeable anonymous-record types.
  • Only TypeScript and Python constrain status to 200; other targets use ordinary integer fields.
  • Optional keys are distinct from nullable values. Numeric singleton leaves use the existing Raw escape hatch.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

- compare existing type composition and target-specific response declarations
- distinguish optional keys and singleton status constraints across languages
- exercise the example through focused assertions and the example smoke suite
@adamcavendish
adamcavendish force-pushed the adamcavendish/response-type-examples branch from c2b914a to 3cadf5a Compare October 19, 2026 12:23
@adamcavendish
adamcavendish merged commit 20531ea into main Oct 19, 2026
10 checks passed
@adamcavendish
adamcavendish deleted the adamcavendish/response-type-examples branch October 19, 2026 12:26
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.

1 participant