Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(type-safe-api): fix named composite models and composite model types #878

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

cogwirrel
Copy link
Member

Smithy uses the title field in OpenAPI to name composite models (all-of, one-of, any-of), which OpenAPI generator also used to produce more readable generated code. This change updates to use the title to name composite models if present for parity with OpenAPI generator.

Additionally, nested composite model properties were typed as any. Since we know that we always hoist and generate a type for composite models, we use the model name as the type for these.

Smithy uses the `title` field in OpenAPI to name composite models (all-of, one-of, any-of), which
OpenAPI generator also used to produce more readable generated code. This change updates to use the
title to name composite models if present for parity with OpenAPI generator.

Additionally, nested composite model properties were typed as `any`. Since we know that we always
hoist and generate a type for composite models, we use the model name as the type for these.
Copy link

nx-cloud bot commented Oct 30, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d47822c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@cogwirrel cogwirrel merged commit a590627 into mainline Oct 30, 2024
4 checks passed
@cogwirrel cogwirrel deleted the fix/one-of-types branch October 30, 2024 05:31
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.

2 participants