why does dns.records.edit() require a full record instead of a Partial<> ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api
Research direction
Start by inspecting the API definition for DNS record edit and compare RecordEditParams with RecordUpdateParams. Verify whether the endpoint accepts a partial payload like the reproduction's zone_id and content only. Done means the TypeScript types accurately reflect the endpoint's required fields, with a regression check for the demonstrated edit call if the API supports partial updates.
Written by the indexing model from the issue text.
Description
Confirm this is a TypeScript library issue and not an underlying Cloudflare API issue
- This is an issue with the TypeScript library
Describe the bug
Sorry if this is a stupid question but doesn't that defeat the purpose of using PATCH ?
I could be confused but it appears the actual API endpoint accepts partial updates e..g. { content: new_ip } but the API definition requires ttl, name, and type making edit and update synonyms.
If the actual API endpoint accepts partials then the API should allow them too e.g. RecordEditParams should be defined with ?: for everything except zoneid: rather than being an exact duplicate of RecordUpdateParams.
If I am confused and the partial update is forcing missing settings to some default then the API is currently correct.
Note: Code generation looks correct. It is the actual spec I am questioning.
To Reproduce
Reproduction is simple. This fragment appears to work fine in a production worker:
await creds.cloudflare.dns.records.edit(dnsid, {
zone_id: creds.zoneid,
content: ip,
})
But when compiled with tsc it refuses to build due to the missing mandatory fields.
Code snippets
OS
Ubuntu 22.04
Runtime version
Typescript 7.0.2
Library version
cloudflare 7.0.0 cloudflare/types 7.0.1 cloudflare/workers-types 5.20260801.1
- Dominant language
- TypeScript
- Stars
- 835
- Forks
- 201
- Avg merge
- 41m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/cloudflare-typescript
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cloudflare-typescript#2821 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
cloudflare/cloudflare-typescript#2811 ·
-
workers.scripts.deployments.list() paginates the wrong field in v7.2.0Possibly taken @airshakur88 claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cloudflare/cloudflare-typescript#2805 · 1 comment · 1 reaction ·
-
Release CalendarOpen
Difficulty 1/5 Under an hour Newbie friendliness 68/100
cloudflare/cloudflare-typescript#2755 · 7 comments · 1 reaction ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 15/100
cloudflare/cloudflare-typescript#2812 ·
All issues in cloudflare/cloudflare-typescript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siyuan-note/siyuan#21692 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-chat-react#3467 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
resend/resend-node#1206 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#1139 ·
Maintainers usually reply within 1 day