Giter Club home page Giter Club logo

Comments (4)

kailuowang avatar kailuowang commented on May 26, 2024

I have an example of the exact use case in the README
https://github.com/iheartradio/play-swagger#how-to-specify-body-content-in-a-post-endpoint
You need to expose your SignUpData as a public class in one of the domain packages you pass in to swagger's generator. See the domain package part in the code example here
https://github.com/iheartradio/play-swagger#step-2

from play-swagger.

Ciantic avatar Ciantic commented on May 26, 2024

Oh right, I have to define this for all. I must find a better way, because my whole API works by reading the input parameters from body. Marking each in the comment at routes file is not a good option.

Also of course private case class is not a good choice, but even as public, it won't recognize them automatically.

from play-swagger.

Ciantic avatar Ciantic commented on May 26, 2024

Maybe I have to do some JsonBodyAction that takes a type that can be validated, then teach the play-swagger to understand JsonBodyAction is automatically a body parser.

from play-swagger.

kailuowang avatar kailuowang commented on May 26, 2024

By design play-swagger avoid being coupled with controller implementations. If you think that adding that comment is too much work(to me it's like a javadoc return statement), then you might want to look at the annotation approach here https://github.com/swagger-api/swagger-play. That lib reflects on your controllers to extract information.

from play-swagger.

Related Issues (20)

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.