Comments (4)
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,
- 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.
- 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.
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.
@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.
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)
- Request parameters not visible in Swagger ui
- Open API spec generated is incorrect
- Swagger generating type zoneddatetime in the swagger json
- Support for Optional in schemas
- Swagger Custom Mappings not working with multiples parameters HOT 1
- array[byte] transforms to array-byte .Must transform string
- Swagger-ui compatibility HOT 4
- How to request a release? HOT 2
- Which PLAY versions must be supported? HOT 2
- Please release 0.11.0 HOT 2
- Allow passing classloader to DefinitionGenerator HOT 1
- Definitions description based on Scaladoc HOT 2
- Please Release 0.13.0
- Reusable enums are not working HOT 1
- Skip routes w/ no Swagger Spec comment HOT 1
- java.util.zip.ZipException: duplicate entry: public/swagger.json HOT 1
- Support Scala 3 HOT 2
- Wildcard matching for `swaggerDomainNameSpaces` HOT 1
- [Urgent] Deployment Failures of This Repository Since April. HOT 4
- Remove Swagger Json from Public Folder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-swagger.