Skip to content

[Feature] Unified proxy response structure to standardize API responses #594

@Issac-Newton

Description

@Issac-Newton

Problem Statement

The current sandbox proxy responses lack a consistent structure making integration difficult. The different endpoints return different response structures which complicates client-side handling.

Proposed Solution

Standardize all API responses to follow consistent structure as described in the new interface response body specification:

  • A standardized response wrapper (BaseResponse with status, message, error fields)
  • Consistent result objects containing code and failure_reason
  • Proper inheritance hierarchy for all response type classes

Changes Made

  • Created specification document at docs/_specs/response/interface_response_body_spec.md
  • Refactored response classes in rock/actions/sandbox/response.py to inherit from SandboxResponse
  • Added code and failure_reason fields to all response types
  • Updated API endpoint responses to use the RockResponse[SpecificResponseType] wrapper
  • Added tests in tests/unit/test_sandbox_response.py to validate compliance
  • Moved interface specification file to proper location for documentation organization

Benefits

  • Consistent API response format makes integration easier
  • Clear documentation of response structures
  • Better error handling with standardized error fields
  • Improved API predictability

Component Affected

  • Sandbox
  • Actions
  • SDK & API
  • Documentation & Examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions