Skip to content

Commit

Permalink
Add description to request boxes for use in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Jul 23, 2024
1 parent c3b67e6 commit f04c615
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stone/backends/swift_rsrc/SwiftRequestBox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
}
}
}

0 comments on commit f04c615

Please sign in to comment.