Skip to content

chore: stale macro definitions and comments in direct.rs after endpoint refactor #209

@userFRM

Description

@userFRM

Problem

After the endpoint architecture refactor (#201, #203), direct.rs still contains ~900 lines including:

  • Old macro definitions (list_endpoint!, parsed_endpoint!, streaming_endpoint!, opt_setter!, opt_field_type!, etc.) that are now used only by the generated code from build_support/endpoints.rs
  • Module-level doc comments (lines 1-50) referencing "Endpoint macros — builder pattern with IntoFuture for all gRPC RPCs" — but the macros are no longer the primary authoring surface
  • Helper functions (validate_date, normalize_interval, contract_spec!) that overlap with the new endpoint.rs validators

The macros still compile and work (the generated code invokes them), but the file reads as if it's the source of truth for endpoint definitions when it's now generated scaffolding.

Proposed solution

  1. Move the macro definitions to a src/macros.rs submodule with a clear doc header: "These macros are invoked by generated code from build_support/endpoints.rs — do not edit directly"
  2. Update the direct.rs module doc to reflect the new architecture
  3. Consolidate overlapping validation (see related issue on validation duplication)

Impact

Developer confusion — anyone reading direct.rs will think the macros are the authoring surface and try to add endpoints there instead of endpoint_surface.toml. Low runtime risk but high maintenance risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions