zalando / friboo

Utility library for writing microservices in Clojure, with support for Swagger and OAuth
Apache License 2.0
119 stars 16 forks source link

Implement bidirectional routing #94

Open dryewo opened 8 years ago

dryewo commented 8 years ago

Sometimes it's necessary to generate a resource URL from a handler function, for example, to provide "location" header. Concatenating strings is not an ideal solution. We can possibly support it by using vendor extension parameter in the spec:

  '/hello/{name}':
    x-path-id: hello-name
    get:
      summary: Gets hello

After this it should be possible to call a function to create a URL:

(path-for (:swagger request) :hello-name "Michael")

Challenges:

Good existing solution: https://github.com/juxt/bidi