Skip to content

fix(crawler): accept all renderJavaScript shapes - #276

Merged
LorrisSaintGenez merged 2 commits into
mainfrom
fix/RenderJavaScript
Jul 30, 2026
Merged

fix(crawler): accept all renderJavaScript shapes#276
LorrisSaintGenez merged 2 commits into
mainfrom
fix/RenderJavaScript

Conversation

@LorrisSaintGenez

Copy link
Copy Markdown
Contributor

What

  • Fix algolia crawler list failing when any crawler config uses the array or object form of renderJavaScript
  • Replace Config.RenderJavaScript bool with a custom type accepting the three API shapes: boolean, array of URL patterns, object (enabled/waitTime/adblock/patterns)
  • Keep the raw payload for faithful round-tripping: JSON output re-emits the exact shape stored on the crawler

Test

go build -o algolia .
./algolia crawler list
./algolia crawler get <crawler-id> --config-only
  • On an account with at least one crawler whose renderJavaScript is an array or object: crawler list lists all crawlers instead of failing with cannot unmarshal array into Go struct field ... of type bool
  • crawler get --config-only returns renderJavaScript in the exact shape shown in the dashboard (array/object preserved)

@codacy-production

codacy-production Bot commented Jul 30, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 40 complexity · 0 duplication

Metric Results
Complexity 40
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes.

@LorrisSaintGenez LorrisSaintGenez self-assigned this Jul 30, 2026
@LorrisSaintGenez
LorrisSaintGenez marked this pull request as ready for review July 30, 2026 20:54
@LorrisSaintGenez
LorrisSaintGenez merged commit d07b575 into main Jul 30, 2026
3 checks passed
@LorrisSaintGenez
LorrisSaintGenez deleted the fix/RenderJavaScript branch July 30, 2026 21:38
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