← Back to list
01Issue
BugShippedExtensionsPublic
Assigneesstack72
Relationships
#2645 Codegen/Cloudflare: create-only required fields block read methods in generated Cloudflare models
Opened by stack72 · 9/28/2026· Shipped 9/29/2026
Follow-up to swamp-club #2287, which fixed this for GCP in PR 341 (codegen/gcp/pipeline.ts nonCreatePathParams, and the create/update templates in codegen/gcp/extensionModelGenerator.ts).
swamp validates the whole GlobalArgsSchema whenever any global argument is set. This generator emits fields that only the create request needs as required there, so read-only methods fail unless callers pass placeholder create values.
Apply the same rule as #2287:
- Keep required only what a non-create method reads from globalArgs, plus synthetic instance names.
- Make create-only required fields optional in GlobalArgsSchema.
- Enforce them with a generated check at the start of create that throws create requires global arguments: before any API call.
- Where update fully replaces the resource (PUT), fill those fields from globalArgs, then from stored state, and throw before the API call if neither has them.
- Regenerate the provider twice (the second run must produce zero diff) and update the provider's design doc.
Required-ness is decided in buildGlobalArgsProperties in codegen/cloudflare/extensionModelGenerator.ts, from createRequired in codegen/cloudflare/pipeline.ts.
Notes:
- account_id and zone_id handling is emitted separately and must stay unchanged: required for single-scope resources, an either-or optional pair otherwise.
- The synthetic name stays required.
- The nested-object requiredSet path is unrelated.
- codegen/cloudflare/factoryAware_integration_test.ts is the natural place for an integration test.
- codegen/designs/cloudflare.md GlobalArgs notes need updating.
02Bog Flow
Shipped
Click a lifecycle step above to view its details.
03Sludge Pulse
Sign in to post a ripple.