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

oas types #271

Merged
merged 1 commit into from
Feb 18, 2025
Merged

oas types #271

merged 1 commit into from
Feb 18, 2025

Conversation

pellicceama
Copy link
Collaborator

@pellicceama pellicceama commented Feb 18, 2025

Important

Type casting adjustments in appRouter.ts and createRouterHandler.ts to use any for router-related functions.

  • Type Casting:
    • In appRouter.ts, cast appRouter to any in generateOpenApiDocument().
    • In createRouterHandler.ts, cast router to any in createOpenApiFetchHandler().
  • Misc:
    • Remove unused import of AppRouter in createRouterHandler.ts.

This description was created by Ellipsis for 0f2f3e3. It will automatically update as commits are pushed.

Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openint ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 5:07pm

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 0f2f3e3 in 1 minute and 23 seconds

More details
  • Looked at 34 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. packages/api/appRouter.ts:121
  • Draft comment:
    Avoid casting appRouter to any; use proper type to preserve type safety.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50%
    The use of as any is a type assertion that bypasses TypeScript's type checking. While generally it's good practice to avoid any, in this case we're dealing with a third-party library function. The author might have used as any because of compatibility issues with the library's type definitions. Without knowing the exact type signature of generateOpenApiDocument, changing to as AppRouter could potentially cause type errors.
    I might be too cautious - using as AppRouter could provide better type safety if the function is designed to work with tRPC routers. The current code is unnecessarily bypassing all type checking.
    However, the fact that the author specifically chose to use as any suggests they might have encountered type compatibility issues. Making this change could break the build if the library's types don't align perfectly with AppRouter.
    While the suggestion promotes better type safety, we don't have enough context about the library's type requirements to be confident this change won't cause issues.
2. packages/api/createRouterHandler.ts:312
  • Draft comment:
    Avoid using 'any' for router; consider using a proper type (e.g., AppRouter) for better type safety.
  • Reason this comment was not posted:
    Marked as duplicate.
3. packages/api/appRouter.ts:121
  • Draft comment:
    Avoid casting appRouter to 'any'; this bypasses type safety. Instead, update generateOpenApiDocument or router types to properly accept AppRouter.
  • Reason this comment was not posted:
    Marked as duplicate.
4. packages/api/createRouterHandler.ts:312
  • Draft comment:
    Casting router to 'any' in createOpenApiFetchHandler weakens type safety. Use a more specific type to ensure correctness.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_VkFPImApmA1fDfEH


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

recurseml bot commented Feb 18, 2025

✨ No issues found! Your code is sparkling clean! ✨

@pellicceama pellicceama merged commit 1aa9bc6 into main Feb 18, 2025
5 checks passed
@pellicceama pellicceama deleted the typecheck-fix branch February 18, 2025 17:13
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