Git Product home page Git Product logo

scalatra-sample-app's Issues

poor example

doesn't work, swagger v1, sbt issues. suggest updating or removing.

applying .{format} to paths

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

endpoint and path are redundant

In this file:

https://github.com/wordnik/scalatra-sample-app/blob/master/src/main/scala/com/wordnik/swagger/sample/PetServlet.scala#L33

the endpoint and path (first param) are redundant. Is there a need for the endpoint type or can it be assumed from the path?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.