-
Notifications
You must be signed in to change notification settings - Fork 2
Integrate plugin-hono-server with API Registry protocol #487
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
Changes from all commits
d7302eb
d937190
a479f82
0dd3222
1c68457
ee68632
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,12 @@ | ||||||||||||||||||||||||||||||
| import { describe, it, expect, vi, beforeEach } from 'vitest'; | ||||||||||||||||||||||||||||||
| import { HonoServerPlugin } from './hono-plugin'; | ||||||||||||||||||||||||||||||
| import { PluginContext } from '@objectstack/core'; | ||||||||||||||||||||||||||||||
| import { PluginContext, ApiRegistry } from '@objectstack/core'; | ||||||||||||||||||||||||||||||
Check noticeCode scanning / CodeQL Unused variable, import, function or class Note
Unused import ApiRegistry.
Copilot AutofixAI 4 months ago In general, unused imports should be removed to avoid confusion and keep the codebase clean. Here, only The best minimal fix is to update the import statement on line 3 to remove No new methods, imports, or definitions are required; we are only simplifying an existing import.
Suggested changeset
1
packages/plugins/plugin-hono-server/src/hono-plugin.test.ts
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||
| import { PluginContext, ApiRegistry } from '@objectstack/core'; | |
| import { PluginContext } from '@objectstack/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note states "The Hono Server Plugin loads routes from the API Registry sorted by priority" but this is misleading. Based on the implementation in
bindEndpoint()(hono-plugin.ts:586-589), the plugin only successfully binds routes for which it has handlers defined increateHandlerForEndpoint(). For custom plugin endpoints registered in the API Registry,bindEndpoint()will log a warning "No handler found for endpoint" and skip binding them.Consider clarifying this note to explain that:
http-serverservice (as shown in the example above at lines 329-336)This would help developers understand that registering an endpoint in the API Registry does not automatically make it functional - they must also bind the handler implementation.