Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Implement bidirectional routing #94

Open
dryewo opened this issue Oct 5, 2016 · 0 comments
Open

Implement bidirectional routing #94

dryewo opened this issue Oct 5, 2016 · 0 comments

Comments

@dryewo
Copy link
Contributor

dryewo commented Oct 5, 2016

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:

  • need to support path parameters for routes
  • need to patch swagger1st to allow vendor extensions on this level
  • (:swagger request) - is it the best way to access the routing information?

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants