# using :txs_scope_range here just to ensure it is unique
swagger_path :txs_scope_range do
get("/txs/{scope_type}/{range}")
...
end
# using :txs_direction here just to ensure it is unique
swagger_path :txs_direction do
get("/txs/{direction}")
...
end
# manually defining swagger_path_txs here, normally it would be defined by `swagger_path(:txs)`
def swagger_path_txs(route = %{path: "/txs/{direction}"}), do: swagger_path_txs_direction(route)
def swagger_path_txs(route), do: swagger_path_txs_scope_range(route)
The swagger_path_txs function will be called from the phx.swagger.generate task, which will then delegate to one of the other swagger_path_xxx functions based on the route path.