Skip to content

[Chore]: Properly generate Emily client #1919

@MCJOHN974

Description

@MCJOHN974

Chore - Properly generate Emily client

1. Description

We generate Emily client based on headers over handlers, which look like this:

#[utoipa::path(
    post,
    operation_id = "newBlock",
    path = "/new_block",
    tag = "new_block",
    request_body = NewBlockEventRaw,
    responses(
        (status = 200, description = "New Block event received successfully"),
        (status = 400, description = "Invalid request body", body = ErrorResponse),
        (status = 404, description = "Address not found", body = ErrorResponse),
        (status = 405, description = "Method not allowed", body = ErrorResponse),
        (status = 500, description = "Internal server error", body = ErrorResponse)
    ),
    security(("ApiGatewayKey" = []))
)]
#[instrument(skip_all, name = "new-block")]

However, this headers are handwritten, and does not depend on actual Emily endpoints structure (which is defined in routes. This can lead to a confusion, where client generated from this headers expect one endpoints structure, while actual endpoints structure (defined in routes) is different. Ideally, we should generate both endpoints structure on client and on Emily itself based on single description, or, at least, add a check that verifies that everything is synced

2. Why It's Necessary

3. Execution Checklist

  • TASK_1
  • TASK_2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions