Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger-ui path parameter conflicting with dot extensions like ".json" #82

Closed
taeold opened this issue Jan 14, 2016 · 0 comments
Closed

Comments

@taeold
Copy link

taeold commented Jan 14, 2016

Some of our service endpoints needs to accept a path parameter followed by an optional .json extension, e.g.

http://foo.com/api/id-12345.json

Currently ring-swagger produces uri's that does not look quite right, e.g.

user=> (require '[ring.swagger.swagger2 :as rs])

user=> (rs/swagger-json 
          {:paths {"/api/:id.json"
           {:get {:parameters {:path {:id String}}}}}})
{:swagger "2.0",
 :info {:title "Swagger API", :version "0.0.1"},
 :produces ["application/json"],
 :consumes ["application/json"],
 :paths {"/api/{id.json}"  ;; <= HERE uh-oh
  {:get {:parameters [{:in :path, :name "id", :description "", :required true, :type "string"}], :responses {:default {:description ""}}}}}, :definitions {}}

For me, "/api/{id}.json" looks better than "/api/{id.json}".

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

No branches or pull requests

1 participant