ajay-kmr / swagger Goto Github PK
View Code? Open in Web Editor NEWGrails Swagger Plugin
Grails Swagger Plugin
I added the swagger plugin to our Grails 3.3.0 project which uses Mongo DB. The integration tests started failing with these errors:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.datastore.mapping.mongo.MongoDatastore]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/validator/spi/resourceloading/ResourceBundleLocator at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
Since we're using Mongo, I was surprised to see these Hibernate-related errors. Am not really sure what's the issue, but I took a quick run at upgrading the swagger plugin to use Grails 3.3. I made the minimal changes to get the plugin to build, but the same issue occurred after I tried the 3.3 upgraded plugin. Am still investigating...
Note: I found that by adding Hibernate5 back into the dependencies, the issue went away; however, we don't want to pollute out dependencies with Hibernate. Also, doing so add further complications, like having to add special mapping configuration to each domain to get it to use Mongo.
How to add sample post request body using examples?
Seems that the plugin is not working with grails 4. is there any plan to support it?
I'll try again maybe with an demo project to investigate better
Hello,
Thanks for provinding this great plugin. However I have done the setup as stated, all the responses and api params are properly described with exception of the Request Params. I have tried different types and combinations, but they seem to be ignored by the service.
Could you please review this code part?
Thanks,
Andrio
Steps to reproduce
Any suggestions you might have would be greatly appreciated.
Error initializing classpath: Could not GET 'https://dl.bintray.com/ajay-kumar/plugins/swagger/swagger/1.0.1/swagger-1.0.1.pom'. Received status code 502 from server: Bad Gateway
Is a temporary issue?
Could not GET 'https://dl.bintray.com/ajay-kumar/plugins/org/grails/plugins/swagger/1.0.0/swagger-1.0.0.jar'. Received status code 403 from server: Forbidden
Disable Gradle 'offline mode' and sync project
If not, how can we solve this?
Thanks!
Version of used swagger-ui library is hardcoded in ApiDocController:
redirect uri: "/webjars/swagger-ui/2.2.5/index.html?url=${request.getRequestURI()}"
Users should be able to add their own version of swagger-ui library in build.gradle and use it instead of 'default' version, provided with a plugin. I suggest moving swagger-ui library version in configuration file (application.yaml/application.groovy).
ApiDocController does not support fetching HTML content from webjars (swagger-ui) with UTF-8, so international characters (like Cyrillic) from swagger annotations descriptions are rendered incorrectly (with question marks - '?')
Hi, thanks for valuable products.
Do you have any plan to support JAX-RS annotations, especcially @java.ws.rs.Path?
I know the document says:
Note:
Only annotations provided by swagger-core are supported and JAX-RS annotations are not supported.
But when generate java(okhttp-gson) SDK source code by swagger-codegen from annotated controller, @path annotation of JAX-RS are very required.
Because when generating swagger yaml from annotated grails application,
"nickname" property effects not only "operationId" but also changes "path" property.
We have to prevent that the "path" change, by using @path to override path change by "nickname".
In application.groovy I added an additional line to disable validation
swagger { // https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md validatorUrl = null }
Nevertheless the error badge due to failing validation (firewall) remains. Did I set the option in the wrong place?
Api operations is not showing in the swagger ui for those controllers where i am using this annotation "@LogExecutionTime(level = 'debug')". When i remove the annotation the api operation works fine.
Hey,
could you update the swagger version, e.g. to 1.5.20 and re-release this plugin?
In 1.5.17 they resolved the issue with the logback-test.xml
, see
https://github.com/swagger-api/swagger-core/releases/tag/v1.5.17
(It took me some hours to find out why my logs disappeared, so I'd like to save this effort for others).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.