Skip to content

fix(api): regen for typed TimingPhasesDto in HTTP check details#12

Merged
caballeto merged 1 commit into
mainfrom
fix/http-timing-typed-dto
Apr 23, 2026
Merged

fix(api): regen for typed TimingPhasesDto in HTTP check details#12
caballeto merged 1 commit into
mainfrom
fix/http-timing-typed-dto

Conversation

@caballeto
Copy link
Copy Markdown
Member

Summary

  • Regenerates internal/generated/types.go and the vendored docs/openapi/monitoring-api.json from the upstream spec to pick up devhelmhq/mono#271.
  • That PR replaces the erroneous Map<String, Object> schema for Http.timing with a typed TimingPhasesDto (nullable ints: dns_ms, tcp_ms, tls_ms, ttfb_ms, download_ms, total_ms).

Why

Before this regen the Go type was:

Timing *map[string]*map[string]interface{} `json:"timing,omitempty"`

…which couldn't actually decode the real wire payload (a flat snake_case object of nullable ints). After regen it's the much more useful:

Timing *TimingPhasesDto `json:"timing,omitempty"`

with TimingPhasesDto exposing typed *int32 fields for each phase. The provider doesn't currently surface check-result timing as a Terraform resource/data-source attribute, so this is a pure type-shape correction that ships in the next release — no provider code edits required.

Diff scope

Pure regen via scripts/regen-from.sh — no hand edits:

  • docs/openapi/monitoring-api.json — spec drop-in
  • internal/generated/types.goHttp.Timing retyped + new TimingPhasesDto model

Test plan

  • make build clean
  • make test — all unit tests pass
  • make lint (golangci-lint run ./...) — 0 issues

Made with Cursor

Picks up the upstream mono fix (devhelmhq/mono#271) that replaces
the misleading `Map<String, Object>` `Http.timing` schema with a
typed `TimingPhasesDto`.

Before regen, the Go type was the nonsensical
    Timing *map[string]*map[string]interface{}
which couldn't actually decode the wire payload (a flat snake_case
object of nullable ints). After regen, `Timing` is a typed
`*TimingPhasesDto` with `*int32` fields for `dns_ms`, `tcp_ms`,
`tls_ms`, `ttfb_ms`, `download_ms`, `total_ms`.

The provider doesn't currently expose check-result timing as a
Terraform resource/data-source attribute, so no resource/datasource
code changes are required — this is a pure type-shape correction
that ships as part of the next release.

Verified: `go build`, `go test ./...`, and `golangci-lint run ./...`
all pass clean.

Made-with: Cursor
@caballeto caballeto merged commit 2a3e514 into main Apr 23, 2026
6 checks passed
@caballeto caballeto deleted the fix/http-timing-typed-dto branch April 23, 2026 18:10
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.

1 participant