Provide directive composition capabilities for Java DSL #620

Closed
jlprat opened this Issue Dec 6, 2016 · 1 comment

Projects

None yet

3 participants

@jlprat
Contributor
jlprat commented Dec 6, 2016

Currently Java DSL only offers route composition. In order to bring the Java DSL at par with the Scala DSL, it would be good to be able to apply composition at Directive level.
At the end it should be possible to write:

val route =
  path("order" / IntNumber) { id =>
    (get | put) { 
      complete(s"Received request for order $id")
    }
  }

like

return path(segment("order").slash(integerSegment()), id -> 
  orElse(Directives::get, Directives::put, () -> 
    complete("Received request for order " + id)
  )
)
@jlprat
Contributor
jlprat commented Dec 6, 2016 edited

I could dive into this one as well 😄

@jlprat jlprat added a commit to jlprat/akka-http that referenced this issue Jan 10, 2017
@jlprat @jlprat jlprat + jlprat Add Composing directives java
Issue: #620
* AnyOf
* AllOf
* bindParameter in PartialApplication
Provide examples and docs
Add `ApiMayChange` annotation as comments
53ae29f
@jlprat jlprat added a commit to jlprat/akka-http that referenced this issue Jan 10, 2017
@jlprat @jlprat jlprat + jlprat Add Composing directives java. Issue: #620
* AnyOf
* AllOf
* bindParameter in PartialApplication
Provide examples and docs
Add `ApiMayChange` annotation as comments
d320559
@ktoso ktoso added a commit that referenced this issue Jan 10, 2017
@jlprat @ktoso jlprat + ktoso Add Composing directives java. Issue: #620 (#662)
* AnyOf
* AllOf
* bindParameter in PartialApplication
Provide examples and docs
Add `ApiMayChange` annotation as comments
2a7b078
@ktoso ktoso closed this Jan 10, 2017
@ktoso ktoso removed the 1 - triaged label Jan 10, 2017
@ktoso ktoso added this to the 10.0.2 milestone Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment