Skip to content

fix(mapper): support Fastify method arrays#78

Merged
steipete merged 6 commits into
openclaw:mainfrom
rohitjavvadi:fix/fastify-route-method-arrays
May 20, 2026
Merged

fix(mapper): support Fastify method arrays#78
steipete merged 6 commits into
openclaw:mainfrom
rohitjavvadi:fix/fastify-route-method-arrays

Conversation

@rohitjavvadi
Copy link
Copy Markdown
Contributor

@rohitjavvadi rohitjavvadi commented May 18, 2026

Summary

  • map Fastify route objects that use a static method array
  • emit one feature per static method while ignoring dynamic/non-string entries
  • add mapper regression coverage for mixed and dynamic method arrays

Tests

  • git diff --check
  • corepack pnpm test src/mapper.test.ts
  • corepack pnpm typecheck
  • corepack pnpm lint
  • corepack pnpm -s test
  • corepack pnpm -s build

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0722ba9d1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/mappers/node-routes.ts Outdated
Comment on lines +782 to +783
} else if (quote === "`" && char === "$" && source[index + 1] === "{") {
return null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve static methods when array includes template entry

In endOfArray, encountering ${...} inside any template literal immediately returns null, which makes readStringArrayLiteral reject the entire method array. For a valid Fastify route like method: ['GET', POST-${suffix}], this drops the static GET mapping instead of ignoring only the dynamic element, so route coverage is silently incomplete for mixed static/dynamic arrays.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 01d27fd. The balanced scanner now carries template literals through route objects/arrays so static method entries are preserved, while dynamic template elements are still filtered at the string-literal reader. Added regression coverage for static entries before and after dynamic template elements.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@steipete steipete requested a review from a team as a code owner May 20, 2026 01:28
@steipete steipete merged commit 3c37235 into openclaw:main May 20, 2026
6 checks passed
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