Repository navigation
fix(docs): use service origins and verify Swagger asset integrity - #135
Conversation
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Replace the RA event-path server overrides with a single / server in both canonical and embedded documents.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Updates RA and TL OpenAPI documents for valid Swagger parsing and same-origin requests.
Changes:
- Removes the duplicate RA
Problemschema. - Uses
/v2for RA and/for TL server URLs. - Synchronizes canonical and embedded documents.
- Two moderate findings remain, each with 3 votes: the RA event-path override still exposes localhost and example-host URLs in both RA documents.
| File | Summary |
|---|---|
spec/api-spec-v2.yaml |
Canonical RA specification; event-path server override remains unresolved. |
spec/api-spec-tl-v2.yaml |
Canonical TL specification. |
internal/adapter/docsui/openapi/tl.yaml |
Embedded TL specification. |
internal/adapter/docsui/openapi/ra.yaml |
Embedded RA specification; event-path server override remains unresolved. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
kperry-godaddy
left a comment
There was a problem hiding this comment.
The relative servers entries are the right call, and I checked the mechanics rather than trusting them: swagger-js resolves a relative server URL against the document URL and strips the trailing slash before it appends the operation path, so the TL's url: / produces clean https://host/v1/... requests. Removing the second Problem also kept the accurate copy: the generic 500 path in errors.go emits no code, so the deleted definition's required: code was the wrong one. Both documents now pass a duplicate-key-strict YAML parse, and the embedded copies are byte-identical to spec/.
One thing I'd settle before this merges, inline on the servers block. Two small notes below.
Not blocking, worth a look
- 97
$refs still point atErrorResponseand 15 atProblem, while every RA failure path emits Problem Details. The deleted duplicate carried the only note that this migration is tracked separately, and I couldn't find an issue for it. Opening one would keep the work item from disappearing with the comment. - Dropping the named hosts changes what a code generator seeds as its default base URL from
servers[0].url. If any SDK build reads this document directly, it will want an explicit base URL now.
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
Signed-off-by: Connor Snitker <csnitker@godaddy.com>
|
The event-feed fix is present in the current branch: The two nonblocking notes are addressed as well:
I also verified the issue #132 report: the duplicate Validation: duplicate-key-aware YAML parsing, canonical/embedded parity, the existing |
kperry-godaddy
left a comment
There was a problem hiding this comment.
Verified at f4ddd7a. The /v1/agents/events override is now url: / in both the canonical and embedded RA documents, so the feed resolves against the serving origin alongside the /v2 root and the TL's /. Both documents pass a duplicate-key-strict YAML parse and the embedded copies are byte-identical to spec/.
#153 covers the ErrorResponse migration, and the README note on explicit base URLs for generated clients settles the other question. I checked the SDK repos: none of the Go or Rust clients read this document's server list, and the Java SDK carries its own copy of the spec.
The Subresource Integrity pins on the Swagger UI assets are a good addition. A mismatched hash fails loudly (the browser refuses the asset and the page renders blank), so the risk of a bad pin going unnoticed is low. If you touch this file again, a test asserting the integrity attributes are present would keep a future edit from dropping them.
The two whitespace lint hits you saw locally are pre-existing on main and outside this change; CI lints only new issues, so they do not affect this PR.

Fix Swagger parsing and requests on deployed RA/TL hosts: remove the duplicate
Problem schema, use
/v2for RA operations and/for TL and the V1 eventsfeed, and keep canonical/embedded documents synchronized.
Pin the existing Swagger UI 5.17.14 CSS and JavaScript with SHA-384 Subresource
Integrity and anonymous CORS. Hashes were checked against the npm tarball's
verified distribution and the actual CDN responses. Generated clients should
receive an explicit deployment base URL.
Validation: static analysis, duplicate-key-aware YAML parsing, matching
canonical/embedded documents, and served Swagger attributes on Ubuntu.
Fixes #132.
AI assistance
Assisted-by: Codex (GPT-6), under Connor Snitker's direction.