conorroche / swagger-doclet Goto Github PK
View Code? Open in Web Editor NEWThis project forked from teamcarma/swagger-jaxrs-doclet
License: Apache License 2.0
This project forked from teamcarma/swagger-jaxrs-doclet
License: Apache License 2.0
There are no instructions/readme for how to run it, and just compiling + running the jar results in the error:
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:152)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:120)
at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:95)
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
at com.tenxerconsulting.swagger.doclet.sample.App.getBaseURI(App.java:74)
at com.tenxerconsulting.swagger.doclet.sample.App.startServer(App.java:27)
at com.tenxerconsulting.swagger.doclet.sample.App.main(App.java:49)
Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:115)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:225)
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:135)
... 6 more
When including swagger-doclet as a dependency and with Java 9+, a maven dependepency resolution error occurs. This problem is due to the use of the following profile in the project pom:
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Oracle Corporation</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
Example of the error when using openJDK 11
[ERROR] Failed to execute goal on project example: Could not resolve dependencies for project com.example:example:jar:openjdk11-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.7.0 at specified path C:\dev\jdk-11.0.1/../lib/tools.jar -> [Help 1]
I haven't yet found a way to cleanly disable the profile dependency in a project using swagger-doclet. Could somebody point me to a workaround, or fix this in this project by include a version in the profile activation section?
Example:
@JsonSubTypes({
@JsonSubTypes.Type(value = AImpl.class)
})
abstract class A {
}
class AImpl extends A {
public B b;
}
@JsonSubTypes({
@JsonSubTypes.Type(value = BImpl.class)
})
abstract class B {
}
class BImpl extends B {
public A a;
}
When parsing these models with ApiModelParser, it falls into infinitely looping.
`apply plugin: 'java'
configurations {
doclet
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
doclet(
[group: 'com.tenxerconsulting', name: 'swagger-doclet', version: '1.0.7'],
[group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.0']
)
}
task generateRestApiDocs(type: Javadoc) {
source = sourceSets.main.allJava
destinationDir = reporting.file("rest-api-docs")
options.classpath = configurations.doclet.files.asType(List)
options.docletpath = configurations.doclet.files.asType(List)
options.doclet = "com.tenxerconsulting.swagger.doclet.ServiceDoclet"
options.addStringOption("apiVersion", "1")
options.addStringOption("docBasePath", "/sps/apidocs")
options.addStringOption("apiBasePath", "/sps")
options.addBooleanOption("skipUiFiles", true)
}`
I have added all of the above to my build.gradle. Whenever I build the project the build fails.
"A problem occurred evaluatiing root project: 'myproject'.
Could not resolve all dependencies for configuration ':doclet'.
Could not download artifact 'com.tenxerconsulting:swagger-doclet:1.0.7@jar'
Artifact 'com.tenxerconsulting:swagger-doclet:1.0.7@jar' not found.
Any ideas?
Edit:
Changed the version to 1.1.3 and it was successful in downloading the dependency, however my project uses Java 7 so i need 1.0.7
Add support for Generic declerations. When the Generic class has a attribute with type T it will be resolved to T when generating the documentation. Today it is only shown as undfefined.
The embedded swagger UI reports an error:
{"schemaValidationMessages":[{"level":"error","message":"Deprecated Swagger version. Please visit http://swagger.io for information on upgrading to Swagger 2.0\""}]}
When pointed at the service.json generated. However, from the changelog, it looks like Swagger-UI 2.1.0 was added recently, in version 1.1.1 (i am using 1.1.3) and did work at that time, so I'm not sure whether this is a bug or potential user error.
hello everyone
iam new to swagger
i need your help to understand how things go
actually, i'm using swagger doclet to generate swagger specification for a rest API
i used the directives from https://github.com/conorroche/swagger-doclet
i added the maven part
but nothing was generated
im expecting service.json file
can anyone give me some help ?
@successResponse 200 - displays "20" as code and "0" in the reason
@errorResponse 400 Invalid ID supplied - displays correctly
@errorResponse 404 - displays "40" as code and "4" as the reason
Need to make sure that if reason is empty or not provided, status code truncation does not occur
Everywhere it lists additionalparam
but it's additionalOptions
as per https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#additionalOptions
Hello,
We have few services where response is of Type org.springframework.data.domain.Page. We need swagger-doclet to support org.springframework.data.domain.Page so that responseType is handled just like list or map.
Eg
/**
*
* @param someParam
* @responseType org.springframework.data.domain.Page <someCustomObject>
*/
@get
@path("/getSomePage")
@produces(MediaType.APPLICATION_JSON)
public Response getSomePage(@QueryParam("someParam") String someParam) ;
Regards,
KPuranik
When including swagger-doclet as a dependency and with Java 9+, a maven dependepency resolution error occurs. This problem is due to the use of the following profile in the project pom:
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Oracle Corporation</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
Example of the error when using openJDK 11
[ERROR] Failed to execute goal on project example: Could not resolve dependencies for project com.example:example:jar:openjdk11-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.7.0 at specified path C:\dev\jdk-11.0.1/../lib/tools.jar -> [Help 1]
I haven't yet found a way to cleanly disable the profile dependency in a project using swagger-doclet. Could somebody point me to a workaround, or fix this in this project by include a version in the profile activation section?
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.