Giter Club home page Giter Club logo

Comments (4)

kailuowang avatar kailuowang commented on May 26, 2024

That's an interesting idea. It would be cool to have such a feature.
There are a couple of things that we have to keep in mind,

  1. Adding reflection on the action method will increase the coupling between play controller implementation and play-swagger. Right now we have reflection but only on simple domain case classes.
  2. we are considering moving towards compilation time schema generation, see #85

I am really curious to see if you can get it working, we probably just need to make sure the logic is modularized properly.

from play-swagger.

lynx44 avatar lynx44 commented on May 26, 2024

I ended up creating this as a plugin. I had to make some changes to the SwaggerSpecGenerator to create some extension points. It may need some cleanup, but I can create a pull request if it looks reasonable.

I also created a new play library to create more strongly typed actions called play-stringent, which makes this possible. I use reflection to read the method signature, which reveals which response codes are being returned.

The plugin library is called play-swagger-reflect. I've published a snapshot to sonatype, and there's documentation on the page. All you really need to know is in the README in that repository.

It'd be great to get some feedback if you have time to check it out. Obviously it's incomplete, but I think it's in a usable state.

from play-swagger.

Javakky-pxv avatar Javakky-pxv commented on May 26, 2024

@lynx44
I may no longer be used, but I would like to use this feature when renewing it as Ver 2.0.0 !
It may be a while before that happens, but I would like to use it while complying with the license 🙇

from play-swagger.

lynx44 avatar lynx44 commented on May 26, 2024

Sure, feel free to use anything you'd like. If you need me to update/change any licenses, I'm happy to do so. I haven't used play or scala in quite a few years.

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.