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): generate models for inline request body schemas #873

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

cogwirrel
Copy link
Member

@cogwirrel cogwirrel commented Oct 24, 2024

Inline request body schemas were typed as any and no model was generated for them.

Address this by hoisting inline request schemas in the same way we do for responses.

Note that OpenAPI generator named these hoisted inline request models <OperationID>Request which
also clashes with the overall operation request model - and resolved it by appending Operation to
the Operation ID (see #789).

We deviate from OpenAPI generator behaviour to avoid this issue recurring by naming the type
<OperationID>RequestContent.

Copy link

nx-cloud bot commented Oct 24, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1df132d. 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.

Inline request body schemas were typed as `any` and no model was generated for them.

Address this by hoisting inline request schemas in the same way we do for responses.

Note that OpenAPI generator named these hoisted inline request models `<OperationID>Request` which
also clashes with the overall operation request model - and resolved it by appending `Operation` to
the Operation ID (see #789).

We deviate from OpenAPI generator behaviour to avoid this issue recurring by naming the type
`<OperationID>RequestContent`.
@cogwirrel cogwirrel merged commit 2f33f29 into mainline Oct 25, 2024
5 checks passed
@cogwirrel cogwirrel deleted the fix/inline-request-bodies branch October 25, 2024 00: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