Skip to main content
← Back to list
01Issue
BugOpenExtensionsPublic
AssigneesNone

Relationships

#4419 dns-records: data schema only has CAA fields, so SRV and other data-carrying records lose their data

Opened by zhann · 11/5/2026

Description

@swamp/cloudflare/dns/dns-records lists SRV (and 12 other data-carrying types) in its type enum, but its data schema only has the CAA fields: flags, tag and value (dns_records.ts L89-L93). zod strips every other field without an error, so an SRV record's priority, weight, port and target never reach Cloudflare and create sends "data":{}.

There's no way around this inside the type. Cloudflare's schema marks SRV's content as readOnly, so data is the only way to write one (dns-records_SRVRecord in Cloudflare's OpenAPI).

Request

Make data the per-type union from Cloudflare's OpenAPI, in both GlobalArgsSchema and InputsSchema. dns-records_dns-record-with-data lists the 13 types: CAA, CERT, DNSKEY, DS, HTTPS, LOC, NAPTR, SMIMEA, SRV, SSHFP, SVCB, TLSA and URI.

Steps to reproduce

With version 2026.10.28.1 pulled, and no network calls beyond a stubbed fetch:

import { model } from "./.swamp/pulled-extensions/@swamp/cloudflare/dns/models/dns_records.ts";

const parsed = model.globalArguments.parse({
  zone_id: "zone-id",
  apiToken: "dummy",
  name: "_imaps._tcp.example.com",
  type: "SRV",
  ttl: 3600,
  data: { priority: 0, weight: 1, port: 993, target: "imap.example.com" },
});
console.log(JSON.stringify(parsed.data));

Output:

{}

Running model.methods.create.execute with those arguments and a stubbed fetch sends this body:

{"name":"_imaps._tcp.example.com","ttl":3600,"type":"SRV","data":{}}

Expected

The SRV fields survive parsing and reach Cloudflare in data.

Environment

  • swamp 20261103.144051.0-sha.325bb769
  • @swamp/cloudflare/dns 2026.10.28.1, type version 2026.10.23.1

Workaround

We added an ensure method with export const extension, which takes data as a method argument and calls the API itself. We'll remove that argument once the schema accepts these fields.

Upstream repository: https://github.com/swamp-club/swamp-extensions

Environment

  • Extension: @swamp/cloudflare/dns@2026.10.28.1
  • swamp: 20261103.144051.0-sha.325bb769
  • OS: linux (x86_64)
  • Deno: 2.9.8
  • Shell: /bin/bash
02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/5/2026, 5:26:35 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

system commented 11/5/2026, 5:26:35 AM

Classified automatically when this issue was filed.

  • Source: Extensions

If you feel this classification is incorrect, add a ripple to tell us so.

Sign in to post a ripple.