Skip to content

Commit 10344ad

Browse files
committed
Improve consuming and producing
1 parent 8dbb71e commit 10344ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/com/github/mduesterhoeft/router/RequestPredicate.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ data class RequestPredicate(
1010
var consumes: Set<String> = setOf("application/json", "application/x-protobuf")
1111
) {
1212

13-
fun consuming(vararg mediaTypes: String) {
13+
fun consuming(vararg mediaTypes: String): RequestPredicate {
1414
consumes = mediaTypes.toSet()
15+
return this
1516
}
16-
fun producing(vararg mediaTypes: String) {
17+
fun producing(vararg mediaTypes: String): RequestPredicate {
1718
produces = mediaTypes.toSet()
19+
return this
1820
}
1921

2022
internal fun match(request: APIGatewayProxyRequestEvent) =

0 commit comments

Comments
 (0)