{
swagger: "2.0",
info: {},
version: "0.0.3",
title: "HelloWorld2Api"
host: "http://localhost:8080",
basePath: "/HelloWorld2/rest",
schemes: [] "http"
}
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>1.5.0</version>
</dependency>
<context-root>HelloWorld2</context-root>
@Path("hello")
@Api(value="hello")
@Produces({"application/json", "application/xml"})
public class HelloREST { ... }
@ApplicationPath("rest")
public class ApplicationConfig extends Application {
/**
* Custom constructor for Swagger
*/
public ApplicationConfig() {
BeanConfig beanConfig = new BeanConfig();
beanConfig.setTitle("HelloWorld2Api");
beanConfig.setVersion("0.0.3");
beanConfig.setSchemes(new String[]{"http"});
beanConfig.setHost("http://localhost:8080");
beanConfig.setBasePath("/HelloWorld2/rest");
beanConfig.setScan(true);
beanConfig.setResourcePackage("io.swagger.resources");
// beanConfig.setResourcePackage("helloworld2.rest");
beanConfig.setPrettyPrint(true);
}
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new java.util.HashSet<>();
resources.add(helloworld2.rest.HelloREST.class);
resources.add(io.swagger.jaxrs.listing.ApiListingResource.class);
resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class);
return resources;
}
}
// beanConfig.setResourcePackage("helloworld2.rest")
beanConfig.setResourcePackage("io.swagger.resources");
Context Path:
/HelloWorld2
Servlet Path:
/rest
Path Info:
/swagger.json
Query String:
null
Stack Trace
org.jboss.resteasy.spi.UnhandledException: java.lang.ArrayIndexOutOfBoundsException: 1
Hi,
First thing would be to use the latest version which is 1.5.9.
Second, the output of the swagger.json you share doesn’t make sense as it’s not even JSON.
Is that the full output you get? Anything else in the logs?
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
First thing would be to use the latest version which is 1.5.9.
Maintenance wise, it’d be very difficult to keep the docs updated with the latest version all the time.
However, the docs do say –
"Check the change log to see information about the latest version and the changes from previous versions.”
--