Skip to content
This repository has been archived by the owner on Aug 24, 2018. It is now read-only.

applying .{format} to paths #1

Open
fehguy opened this issue Jun 18, 2012 · 0 comments
Open

applying .{format} to paths #1

fehguy opened this issue Jun 18, 2012 · 0 comments

Comments

@fehguy
Copy link
Contributor

fehguy commented Jun 18, 2012

Swagger defines the request/response format at the api level--it's typically shown in the resource listing like this:

http://petstore.swagger.wordnik.com/api/resources.json

That means, you can get api listings by following the paths with the specified format:

http://petstore.swagger.wordnik.com/api/pet.json

Inside the api, you can then access the resource by concatenating the basePath in the api listing with the operation path, which by convention has the .{format} in it, if used.

With this example, the http://localhost:8080/api/pet.json shows the .{format} correctly, but the servlet listens to the the path without the format:

http://localhost:8080/api/pet/3

Note the missing .json in the path

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

No branches or pull requests

1 participant