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 generated react hooks compilation issues #605

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

cogwirrel
Copy link
Member

@cogwirrel cogwirrel commented Oct 18, 2023

@tanstack/react-query v5 was released earlier, and the hooks project did not pin the version resulting in code which failed to compile. Pin to v4 for now to address this.

Additionally, the @paginated trait in Smithy specifies the Smithy member name which is not the name used in the final generated code, since Smithy -> OpenAPI translation will rename parameters to the name provided in the @httpHeader or @httpQuery traits.

Additionally the generated typescript client will use valid parameter names, eg kebab-case becomes camelCase, so we must address this too by ensuring we use camelCase in the generated hooks code.

Fixes #604

@tanstack/react-query v5 was released earlier, and the hooks project did not pin the version
resulting in code which failed to compile. Additionally the @paginated trait in Smithy specifies the
Smithy member name which is not the name used in the final generated code, since Smithy -> OpenAPI
translation will rename parameters to the name provided in the @HTTPHeader or @httpQuery traits.
Additionally the generated typescript client will use valid parameter names, eg kebab-case becomes
camelCase, so address this too.

Fixes #604
@martenpayne
Copy link
Contributor

looks good 👍

@cogwirrel cogwirrel merged commit 17aa81b into mainline Oct 18, 2023
4 checks passed
@cogwirrel cogwirrel deleted the fix/react-hooks-version-rename branch October 18, 2023 03:11
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] (type-safe-api) generated hooks don't compile
2 participants