Skip to content

fix(recipes): correct error_descriptor/error_parts field names to match API - #96

Merged
zaynelt merged 1 commit into
workato-devs:zt/api-gap-closurefrom
Abhishek-Bhatta:fix/error-descriptor-shapes
Jul 23, 2026
Merged

fix(recipes): correct error_descriptor/error_parts field names to match API#96
zaynelt merged 1 commit into
workato-devs:zt/api-gap-closurefrom
Abhishek-Bhatta:fix/error-descriptor-shapes

Conversation

@Abhishek-Bhatta

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the review on #93 — targets zt/api-gap-closure directly (per @zaynelt's request in this comment) rather than develop, since it's a correction on top of that PR's existing structs.

ErrorDescriptor and ErrorParts declared json tags (type, message) that don't exist in the real Workato API response, so both structs silently decoded to their zero value on every real job — verified against a live dev API job (GET /recipes/{id}/jobs/{job_id}):

"error_descriptor": {"error_type":"Exception","error_id":"35601e00-...","line_number":null,"adapter":"Workato","error_at":"...","actionable":true,"action":null,"trigger":null}
"error_parts": {"message":"...","error_type":"Exception","error_id":"35601e00-...","action":"make_request_v2","line_number":6,"adapter":"rest","retry_count":0}

This PR:

  • Corrects both structs' field names/types to match the real schema
  • Expands HTTPResponse (protocol, normalized_status_text) and ErrorDetails (message, inner_message) to match the full response
  • Registers all four structs (ErrorDescriptor, ErrorDetails, HTTPResponse, ErrorParts) in TestStructFieldCoverage — none of them were covered before, which is how the mismatch went unguarded
  • Extends TestRecipeService_GetJob to assert on the real field names

Verified end-to-end against a live failed job — error_descriptor and error_parts now populate correctly instead of decoding empty.

Checklist

  • go build ./... and go test ./... pass
  • Docs / CHANGELOG.md updated as needed — not touched; scoped as a correction to unreleased structs from Zt/api gap closure #93, no user-facing behavior to log yet
  • N/A ADR check — no ADR covers this

…ch API

ErrorDescriptor and ErrorParts declared json tags ("type", "message") that
don't exist in the Workato API response. The real fields are error_type,
error_id, line_number, adapter, error_at, actionable, action, trigger (on
error_descriptor) and message, error_type, error_id, action, line_number,
adapter, retry_count (on error_parts) — verified against a live dev API job.
Both structs silently decoded to their zero value on every real job.

Also expands HTTPResponse (protocol, normalized_status_text) and
ErrorDetails (message, inner_message) to match the full response, and
registers all four structs in TestStructFieldCoverage so a future field
rename can't regress silently again.
@zaynelt
zaynelt merged commit 802751f into workato-devs:zt/api-gap-closure Jul 23, 2026
@zaynelt

zaynelt commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Abhishek-Bhatta! Really appreciate you catching the omissions & errors and contributing the correct shapes.

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