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 typescript handler dist path for operations with inline request bodies #607

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

cogwirrel
Copy link
Member

When an operation has inline request body schemas (rather than a $ref) in OpenAPI, the operation ID is suffixed with Operation in the generated code, but the operation "nickname" remains unchanged.

eg. operationID = sayHelloOperation, nickname = sayHello

Previously, the operation ID was used for the handler dist reference in the generated lambda function constructs (eg referencing say-hello-operation in the dist folder), but the nickname was used to generate the actual filename (eg say-hello.ts, which becomes say-hello/index.js in the dist folder). This meant that the reference pointed to a folder that didn't exist!

Address this by using the nickname in both places for typescript generated functions.

Fixes #606

…ith inline request bodies

When an operation has inline request body schemas (rather than a $ref) in OpenAPI, the operation ID
is suffixed with "Operation" in the generated code, but the operation nickname remains unchanged.
Previously, the operation ID was used for the handler dist reference in the generated functions, but
the nickname was used to generate the actual filename. Address this by using the nickname in both
places for typescript generated functions.

Fixes #606
@agdimech agdimech merged commit c922390 into mainline Oct 19, 2023
3 checks passed
@agdimech agdimech deleted the fix/tsapi-ts-code-path branch October 19, 2023 23:03
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.

[BUG] incorrect lambda code file path for OpenAPI PUT/POST http methods
2 participants