From f04c6155f16eff0d766935e885177077650bc013 Mon Sep 17 00:00:00 2001 From: Julian Locke Date: Tue, 23 Jul 2024 15:00:13 -0700 Subject: [PATCH] Add description to request boxes for use in tests --- stone/backends/swift_rsrc/SwiftRequestBox.jinja | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stone/backends/swift_rsrc/SwiftRequestBox.jinja b/stone/backends/swift_rsrc/SwiftRequestBox.jinja index 6325b9a4..94742f56 100644 --- a/stone/backends/swift_rsrc/SwiftRequestBox.jinja +++ b/stone/backends/swift_rsrc/SwiftRequestBox.jinja @@ -7,9 +7,17 @@ import Foundation /// Allows for heterogenous collections of typed requests -public enum {{ class_name }} { +public enum {{ class_name }}: CustomStringConvertible { {% for route in background_compatible_routes %} case {{ fmt_func(route.name, route.version) }}({{ request_type_signature(route) }}) {% endfor %} -} + public var description: String { + switch self { + {% for route in background_compatible_routes %} + case .{{ fmt_func(route.name, route.version) }}(_): + return "{{ fmt_func(route.name, route.version) }}" + {% endfor %} + } + } +}