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
- 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"
- Update the
direct.rs module doc to reflect the new architecture
- 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.
Problem
After the endpoint architecture refactor (#201, #203),
direct.rsstill contains ~900 lines including:list_endpoint!,parsed_endpoint!,streaming_endpoint!,opt_setter!,opt_field_type!, etc.) that are now used only by the generated code frombuild_support/endpoints.rsvalidate_date,normalize_interval,contract_spec!) that overlap with the newendpoint.rsvalidatorsThe 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
src/macros.rssubmodule with a clear doc header: "These macros are invoked by generated code from build_support/endpoints.rs — do not edit directly"direct.rsmodule doc to reflect the new architectureImpact
Developer confusion — anyone reading
direct.rswill think the macros are the authoring surface and try to add endpoints there instead ofendpoint_surface.toml. Low runtime risk but high maintenance risk.