Skip to content

fix: serialize type_schema as JSON in attestation type table output#742

Merged
jbpros merged 1 commit intomainfrom
reflect-custom-att-type-json-changes
Mar 27, 2026
Merged

fix: serialize type_schema as JSON in attestation type table output#742
jbpros merged 1 commit intomainfrom
reflect-custom-att-type-json-changes

Conversation

@jbpros
Copy link
Copy Markdown
Contributor

@jbpros jbpros commented Mar 27, 2026

The server now returns type_schema as a JSON object instead of a Python repr string. The CLI was printing it with fmt %s, producing Go's map representation. Marshal it back to JSON for proper display.

The server now returns type_schema as a JSON object instead of a Python
repr string. The CLI was printing it with fmt %s, producing Go's map
representation. Marshal it back to JSON for proper display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbpros jbpros enabled auto-merge (squash) March 27, 2026 15:23
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 27, 2026

Claude finished @jbpros's task in 1m 36s —— View job


PR Review: serialize type_schema as JSON in attestation type table output

  • Run static analysis checks (go build, go vet, go mod tidy)
  • Review code changes
  • Post review feedback

Static Analysis

All checks pass:

  • go build ./... — clean
  • go vet ./... — clean
  • go mod tidy — no changes to go.mod/go.sum

Review

This is a clean, well-scoped fix. The change correctly handles the server-side switch from Python repr strings to JSON objects by marshaling the type_schema value back to JSON before display.

What looks good:

  • Proper error handling on json.Marshal with early return, consistent with the existing pattern in the function (e.g., line 162)
  • Golden files updated to reflect the new JSON output (keys alphabetically sorted by json.Marshal, true instead of Python's True)
  • Minimal diff — only touches what's necessary

One minor observation:

The json.Marshal output is compact (no indentation). For a potentially nested schema, this could be hard to read in table output. That said, this matches the existing behavior of other fields and keeps the table layout clean, so it's a reasonable choice for now. Pretty-printing could be a follow-up if users find it hard to read.

No issues found. LGTM — this is ready to merge.

@jbpros jbpros disabled auto-merge March 27, 2026 15:30
@jbpros jbpros merged commit b138726 into main Mar 27, 2026
16 checks passed
@jbpros jbpros deleted the reflect-custom-att-type-json-changes branch March 27, 2026 15:32
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.

2 participants