Skip to content

fix(api): OpenAPI StackRequest additionalProperties + generic 404 hint cleanup (DOG-30 + BUG-API-105)#186

Merged
mastermanas805 merged 2 commits into
masterfrom
fix/api-openapi-stack-schema-and-anon-rate-limit-msg-2026-05-30
May 30, 2026
Merged

fix(api): OpenAPI StackRequest additionalProperties + generic 404 hint cleanup (DOG-30 + BUG-API-105)#186
mastermanas805 merged 2 commits into
masterfrom
fix/api-openapi-stack-schema-and-anon-rate-limit-msg-2026-05-30

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

@mastermanas805 mastermanas805 commented May 30, 2026

Summary

  • DOG-30: StackRequest schema had a literal property named "<service-name>" — codegen clients (Postman, openapi-generator) interpreted it as a real property and emitted upload code with that exact literal field name. Replaced with additionalProperties (OpenAPI-3 idiom for dynamic field names).
  • BUG-API-105: generic 404 agent_action tacked on "anon resources also auto-expire after 24h" — irrelevant on typo'd / internal / authenticated misroutes. Hint kept on surface-specific 404s (webhook_not_found etc.) where it IS actionable.

Rule-17 coverage block (DOG-30)

  • Symptom: StackRequest schema property literally named "<service-name>"
  • Enumeration: rg -F '<service-name>' internal/handlers/openapi.go — 2 hits
  • Sites touched: 1 (StackRequest property — the schema bug). The other hit is human-prose description, not a property name.
  • Coverage test: TestOpenAPI_StackRequestUsesAdditionalProperties — asserts the literal property is gone AND additionalProperties is present with type: string + format: binary.

Rule-17 coverage block (BUG-API-105)

  • Symptom: 404 agent_action says "anon resources auto-expire" on internal/typo'd routes
  • Enumeration: rg 'anon resources' internal/ --type go — 2 hits
  • Sites touched: 1 (generic not_found — generic). webhook_not_found kept because the auto-expire footnote IS valid context for a webhook-token 404.

Test plan

  • go build ./... / go vet ./...
  • go test ./internal/handlers/ -short -count=1 -run TestOpenAPI (all pass including new TestOpenAPI_StackRequestUsesAdditionalProperties)
  • go test ./internal/handlers/ -short -count=1 -run TestAgentAction|TestHelpers|TestRespondError (clean)
  • Post-merge: curl /openapi.json | jq '.components.schemas.StackRequest.additionalProperties' returns binary-upload shape; curl -X GET /internal/set-tier agent_action no longer mentions "anon resources auto-expire"

@mastermanas805 mastermanas805 changed the title fix(openapi): StackRequest uses additionalProperties for per-service tarballs (DOG-30) fix(api): OpenAPI StackRequest additionalProperties + generic 404 hint cleanup (DOG-30 + BUG-API-105) May 30, 2026
@mastermanas805 mastermanas805 force-pushed the fix/api-openapi-stack-schema-and-anon-rate-limit-msg-2026-05-30 branch from 7201607 to fa4da7d Compare May 30, 2026 05:44
mastermanas805 and others added 2 commits May 30, 2026 11:30
…tarballs (DOG-30)

StackRequest used to model the dynamic per-service multipart field as a
literal property named "<service-name>". OpenAPI-3 codegen clients
(Postman, openapi-generator, etc.) read this as "a property literally
named <service-name>" — so generated upload code emits a field with
that exact literal name and the deploy fails.

Now: the dynamic field is expressed via additionalProperties (the
OpenAPI-3 idiom for "any additional property with this shape"). The
description spells out the contract — for every service in
manifest.services, emit one multipart field named after the real service
name whose value is the gzipped tar of that service's build context.
Codegen clients now produce correct upload loops.

Existing CLI/dashboard/MCP clients build the multipart body imperatively
from manifest.services (not from the OpenAPI schema) so this is purely
a docs/contract improvement — no runtime behaviour change.

Coverage block:
  Symptom:        StackRequest schema property literally named "<service-name>"
  Enumeration:    rg -F '<service-name>' internal/handlers/openapi.go
  Sites found:    2 (StackRequest property + StackResponse.services.url
                  description, where it's a real placeholder in human prose)
  Sites touched:  1 (StackRequest property — the schema bug). The
                  StackResponse description text is human prose, not a
                  property name.
  Coverage test:  TestOpenAPI_StackRequestUsesAdditionalProperties —
                  asserts the literal '<service-name>' property is gone
                  AND additionalProperties is present with the binary-
                  upload shape. Fails today before the schema change.
  Live verified:  pending merge + auto-deploy + curl /openapi.json
                  | jq '.components.schemas.StackRequest'

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rom generic 404 (BUG-API-105)

The generic "not_found" agent_action used to tack on "anon resources
also auto-expire after 24h" — irrelevant when the 404 is a typo'd path,
unknown internal endpoint, or authenticated misroute. Hint is kept on
the surface-specific 404s (webhook_not_found etc.) where the auto-
expire footnote IS actionable.

Coverage block:
  Symptom:        404 agent_action says "anon resources auto-expire" on
                  any 404 including internal/typo'd routes
  Enumeration:    rg 'anon resources' internal/ --type go
  Sites found:    2 — webhook_not_found (kept; correct context) +
                  generic not_found (changed)
  Sites touched:  1 (generic not_found)
  Coverage test:  N/A — agent_action contract is the prose itself; no
                  test pins the exact wording for the generic 404 today.
  Live verified:  pending merge + auto-deploy + curl unknown path

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the fix/api-openapi-stack-schema-and-anon-rate-limit-msg-2026-05-30 branch from fa4da7d to d09c91d Compare May 30, 2026 06:00
@mastermanas805 mastermanas805 merged commit f286d45 into master May 30, 2026
14 checks passed
@mastermanas805 mastermanas805 deleted the fix/api-openapi-stack-schema-and-anon-rate-limit-msg-2026-05-30 branch May 30, 2026 06:15
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