Skip to content

Refactoring envelope of successful responses and its client contract #256

Open

Description

@tmikula-dev

Summary

Revisit the envelope of successful (HTTP 200) responses from the stats lambda. Every success body currently contains two fields that duplicate the HTTP response:

{"success": true, "statusCode": 200, "data": [...], "pagination": {...}}
{"success": true, "statusCode": 200, "aggregations": {...}}
  • success: true is already implied by the 2xx status code.
  • statusCode is repeated in the body, although it is already the API Gateway statusCode.

This is built in src/utils/utils.py (success response builders for data/pagination and aggregations).

Background

Raised by @lsulak in review of PR #243: "success is quite visible from the status code, and then also status code is there twice. Is there any situation when it differentiates?"

Activity

  1. added
    refactoringImproving code quality, paying off tech debt, aligning APIs
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringImproving code quality, paying off tech debt, aligning APIs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions