Commit 5586305
refactor: fetch API endpoint catalog on demand and harden apify api
Download https://docs.apify.com/api/openapi.json at runtime when
--list-endpoints is used, instead of bundling a pre-generated
api-endpoints.json. Drops the prepack fetch step and the fetch-api-endpoints
script so the list can no longer go stale between releases.
While here, address staff-review findings on the apify api command:
- ^v2\/? could over-strip paths like "v2things/x"; require a trailing slash
and accept it case-insensitively.
- --body was silently sent on GET/HEAD, triggering an unfriendly fetch
TypeError. Reject early with a clear validation message.
- Custom headers could duplicate Content-Type due to case differences; apply
overrides case-insensitively.
- On non-2xx responses, write the JSON response body to stdout (matches
gh api) so pipelines like `apify api ... | jq` still receive the payload;
status line stays on stderr.
- Document the one-header-per-invocation restriction in --header.
- Reset process.exitCode in beforeEach and capture actorId before
assertions so the api-tests don't pass on inherited state or leak actors
when an assertion fails.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 735090e commit 5586305
7 files changed
Lines changed: 162 additions & 726 deletions
File tree
- docs
- scripts
- src/commands
- test
- api/commands
- local/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
This file was deleted.
0 commit comments