Module: Belt::CLI::RoutesCommand::RequestModelInference
- Included in:
- Belt::CLI::RoutesCommand
- Defined in:
- lib/belt/cli/routes_command/request_model_inference.rb
Overview
Infers request_model and response_model from contracts using naming conventions.
Request model convention cascade (first match wins):
1. :<verb>_<gateway>_<singular_resource> (e.g. :create_customer_item)
2. :<verb>_<singular_resource> (e.g. :create_item)
Response model convention:
Singular of the resource name matches a `model` in contracts.
e.g. `resources :items` → looks for `model :item` in contracts.rb
Only request_model inference applies to body-accepting verbs (POST/PUT/PATCH). Response model inference applies to all verbs on resource routes. Explicit values always win — inference only fills in blanks.