Coder Social home page Coder Social logo

swagger4spring-web's Introduction

swagger4spring-web

Please note: This project is no longer actively supported.

Supports Swagger 1.3 as of version 0.3.0!

This project aims at providing Swagger support to your Spring-Web based application. It will attempt to document your API based on existing Spring-Web annotations if no Swagger annotations exist. If Swagger annotations do exist, it will utilize those in conjunction with the Spring-Web annotations.

##How-To

To include swagger4spring-web in your project, you need to include the jar in your project. If you use Maven, please include the following dependency:

    <dependency>
        <groupId>com.knappsack</groupId>
        <artifactId>swagger4spring-web</artifactId>
        <version>0.3.5</version>
    </dependency>

Java 8+ users, please compile your source using the javac "-parameters" argument. This ensures that your parameter names display correctly in your API documentation.

In order to use swagger4spring-web in your project, you need to declare an ApiDocumentationController bean in your servlet context. For example:

    <beans:bean id="documentationController" class="com.knappsack.swagger4springweb.controller.ApiDocumentationController"
            p:basePath="http://localhost:8080/yourapp"
            p:baseControllerPackage="com.knappsack.swagger4springweb.controllers.api"
            p:baseModelPackage="com.knappsack.swagger4springweb.models"
            p:apiVersion="v1" />
  • basePath - optional - the base URL of your web application, for example http://localhost/swagger4spring-web-example
  • baseControllerPackage - optional - this is the package you want swagger4spring-web to scan to look for classes annotated with @Controller. If this is not set, all your packages are scanned.
  • baseModelPackage - optional - this is the package you want to scan if all your model objects are in a specific directory. These classes will be added to your documentation schema. If no package is specified only certain return types and parameters are added to the documentation schema.
  • additionalControllerPackage - optional - if you have more packages with controllers outside of the baseControllerPackage, specify them here.
  • additionalModelPackage - optional - if you have packages outside of the baseModelPackage that you want to scan for models, specify them here.
  • apiVersion - required - this is the version of your API
  • apiInfo - optional - if you have information you wish to provide, such as license and terms of service, set this.

If you are using version 0.3.0 or above, you'll also need to add the following to the appropriate Spring context file in your application:

<mvc:annotation-driven>
    <mvc:message-converters>
        <beans:bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
            <beans:property name="objectMapper">
                <beans:bean class="com.knappsack.swagger4springweb.util.ScalaObjectMapper"/>
            </beans:property>
        </beans:bean>
    </mvc:message-converters>
</mvc:annotation-driven>

Once the ApiDocumentationController is wired, you may call go to your base path + /api/resourceList (ex: http://localhost/swagger4spring-web-example/api/resourceList) in order to retrieve an inventory of your APIs. For an example JSP see this page.

#####Alternative Implementation

If you wish to use a different request mapping then you may extend create a new controller that extends ApiDocumentationController. For example if you want the URL to be /documentation/resourceList instead of /api/resourceList you can create a controller like this:

@Controller
@RequestMapping(value = "/documentation")
public class ExampleDocumentationController extends ApiDocumentationController {

    public ExampleDocumentationController() {
        setBaseControllerPackage("com.knappsack.swagger4springweb.controllers.api");
        setBaseModelPackage("com.knappsack.swagger4springweb.models");
        setApiVersion("v1");
    }

   @RequestMapping(value = "/", method = RequestMethod.GET)
   public String documentation() {
        return "documentation";
    }
}

In this case you don't have to create the controller bean in your servlet context if you are using component scanning and your new controller is set to be picked up in the scan.

To see a working example, please take a look at swagger4spring-web-example.

##Annotation Support The following Spring-Web annotations are supported:

  • @Controller
  • @RestController
  • @RequestMapping
  • @ResponseBody
  • @RequestBody
  • @PathVariable
  • @RequestParam
  • @ApiExclude - This annotation is unique to swagger4spring-web. It allows you to specify a controller or method for which you do not want to generate Swagger documentation.

The following Swagger annotations are supported:

  • @Api
  • @ApiResponse
  • @ApiResponses
  • @ApiOperation
  • @ApiParam
  • @ApiModel
  • @ApiModelProperty

##External Links Swagger Home

Swagger Wiki

##Change Log https://github.com/wkennedy/swagger4spring-web/wiki/Change-Log

##License Copyright (c) 2014 Will Kennedy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

swagger4spring-web's People

Contributors

dthoffdev avatar fehguy avatar micksear avatar mzruya avatar ncb000gt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swagger4spring-web's Issues

ApiDocumentationController - getResources() doesnt convert to JSON

I have just upgraded swagger to the following versions
swagger-core -> 1.3.1
swagger-annotations -> 1.3.0
swagger-ui -> 2.0.3
swagger4spring-web -> 0.3.0

After doing so I tried to go to /api/docs/resourceList and it returns "{ }"
When I step through your code in ApiDocumentationController - getResources() it looks like it creates the correct ResourceListing object however it looks like Spring/Jackson does not correctly convert it to a JSON object before it gets past back to the client.

I am using
Spring - 3.2.4.RELEASE
Jackson - 2.2.2

I have already tried to exclude jackson from getting imported from swagger-core

Any ideas on what could be happening here?

Generated api has an Option field instantiated as null

When using the ApiParserImpl's createApiListings() method to generated the swagger model, the deprecated field inside the operations of the apis, which is of type Option[String] has a value of null, which causes the swagger json serializer to crash.

I was able to fix it using the following code, but I think the null should not have been there in the first place.

val fixedApis = apis.map(api => api.copy(operations = api.operations.map(operation => operation.copy(deprecated = Option(operation.deprecated).flatten))))

How do I add a SpecFilter??

I need to add a SpecFilter in order to exclude certain field params. I am loosely following this post to do it:

http://stackoverflow.com/questions/21911166/how-can-i-set-swagger-to-ignore-suspended-asyncresponse-in-asynchronous-jax-rs

but that's for JaxRS. So for Spring I tried to do this:

public class DocumentationController extends ApiDocumentationController {
   public DocumentationController(){

       com.wordnik.swagger.config.FilterFactory.setFilter(new MySwaggerSpecFilter());

       ApiInfo apiInfo = new ApiInfo("swagger4spring-web example app", "This is a basic web app for demonstrating swagger4spring-web",
               "http://localhost:8080/terms", "http://localhost:8080/contact", "MIT", "http://opensource.org/licenses/MIT");

       setApiInfo(apiInfo);
   }
}

but it doesn't work.

Can API Docs be separated into multiple pages

Hello, I'm currently working on developing a swagger patch for my company's new API. The issue is that right now every controller is listed onto the same page but we would like to be able to separate these into different pages. We were using springmvc but this functionality doesn't seem possible. Is this doable or not?

Exclude an API

Hi, i'm happy to find a project that looks like a solid foundation for proper Swagger Spring MVC integration,
i'd like to propose an enhancement.

Some API's are internal, and u wouldn't want to expose them to the customer in the form of swagger documents, but u would still like to document them in your code using the annotations like any other API.

I propose adding an annotation in the form of @ApiExclude (or something with a similar name), this annotation can be added to a class or method.

I would be happy to implement and send a pull request,

What do u think ?

Thanks..

Doesn't handle ResponseEntity return types well

All of my controllers use the Spring 3.2 way of rest service production. That is they return objects that are wrapped in ResponseEntity. For example:

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<List> getUsers() {

...

    return new ResponseEntity<List<UserResponseDTO>>(userList, HttpStatus.OK);

}

so the doc output looks like:

......
[{"httpMethod":"GET","responseClass":"ResponseEntity","nickname":"getUser","parameters":[{"name":"name","paramType":"path","required":true,"allowMultiple":false,"dataType":"string"}]
...

Ideally the parser would be able to detect the generic being used here as User.

@ApiOperation with value only breaks displaying documentation for Api (controller)

Description:
I would expect to define only required properties in @ApiOperation and allow swagger4spring to get default values for others. Currently @ApiOperation with value only causes an API for a class (controller) to be not expandable in GUI.

How to reproduce:
In swagge4springweb-example (tested on master) for person() method in PersonController change @ApiOperation to @ApiOperation(value = "Find specific person").

Additional notes:
Maybe related thing - it would be nice to have to define response field only for not trival classes (e.g. wrappers like ResponseEntity). Currently even for simple classes defined as @apimodel (like Person) response type is not shown in GUI if response is not explicit defined.

Swagger is empty when deployed to a server

Hello,

So I'm sure that this is going to be too vague to solve probably but I figured that it would at least be worth a shot posting here since I'm desperate. My co-worker and I have finally gotten swagger to work flawlessly locally but as soon as we deploy the project as a war on a server, swagger breaks. The .jsp files that we have are still showing up but the json files that we are getting have an empty API array and thus are not displaying anything other than information we have in the ApiInfo tag of our document controller. Its as if the controllers we are scanning do not exist even though they do. Heard of anything like this happening?

We are swagger4spring-web so this maybe specific to that but we thought it might be swagger related

Not finding any API controllers

Firstly, thanks for putting this together!

I am running into a problem where no controllers at all are being discovered. Using 0.3.0, I just get an empty json response when I hit /api/resourceList. If I switch to 0.2.0, I get the following:
{"api_version":"v1","swagger_version":"1.1","base_path":"http://localhost:7001/test-server"}

But, I do not see any API endpoints being identified. I have configured as per the docs, specifically:

pom.xml
Added the dependency as well as some exclusions to avoid guava and jackson conflicts

        <dependency>
            <groupId>com.knappsack</groupId>
            <artifactId>swagger4spring-web</artifactId>
            <version>0.2.0</version>
            <exclusions>
                <exclusion>
                   <groupId>com.fasterxml.jackson.core</groupId>
                   <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

application-context.xml

    <bean id="documentationController" class="com.knappsack.swagger4springweb.controller.ApiDocumentationController">
        <property name="apiVersion" value="v1" />
        <property name="baseControllerPackage" value="com.testapp.rest.controller" />
        <property name="baseModelPackage" value="com.testapp.core.model" />
    </bean>

spring-mvc.xml
To test using 0.3.0 I did add the following:

    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                <property name="objectMapper">
                    <bean class="com.knappsack.swagger4springweb.util.ScalaObjectMapper"/>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

I have tried with and without annotating a controller using @ApiOperation and @Api but I always end up with an empty set of api endpoints.

Can you please me know if there is something missing in my configuration and/or if there are some known issues with either of these versions that would cause this.

Thanks,
Andrew

Class Cast

Hi, I have this exception during model parsing:

my config is:

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
at com.wordnik.swagger.core.ApiPropertiesReader$.getDataType(SpecReader.scala:84)
at com.wordnik.swagger.core.ApiPropertiesReader$.getDataType(SpecReader.scala:74)
at com.wordnik.swagger.jsonschema.ApiModelParser.parsePropertyAnnotations(SwaggerJsonSchemaProvider.scala:150)
at com.wordnik.swagger.jsonschema.ApiModelParser.com$wordnik$swagger$jsonschema$ApiModelParser$$parseMethod(SwaggerJsonSchemaProvider.scala:96)
at com.wordnik.swagger.jsonschema.ApiModelParser$$anonfun$parseRecurrsive$1.apply(SwaggerJsonSchemaProvider.scala:79)
at com.wordnik.swagger.jsonschema.ApiModelParser$$anonfun$parseRecurrsive$1.apply(SwaggerJsonSchemaProvider.scala:77)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
at com.wordnik.swagger.jsonschema.ApiModelParser.parseRecurrsive(SwaggerJsonSchemaProvider.scala:77)
at com.wordnik.swagger.jsonschema.ApiModelParser.parseRecurrsive(SwaggerJsonSchemaProvider.scala:86)
at com.wordnik.swagger.jsonschema.ApiModelParser.parseRecurrsive(SwaggerJsonSchemaProvider.scala:86)
at com.wordnik.swagger.jsonschema.ApiModelParser.parse(SwaggerJsonSchemaProvider.scala:68)
at com.knappsack.swagger4springweb.parser.DocumentationSchemaParser.getParameterDocumentationSchema(DocumentationSchemaParser.java:42)
at com.knappsack.swagger4springweb.parser.ApiParserImpl.processMethods(ApiParserImpl.java:139)
at com.knappsack.swagger4springweb.parser.ApiParserImpl.processControllers(ApiParserImpl.java:82)
at com.knappsack.swagger4springweb.parser.ApiParserImpl.createDocuments(ApiParserImpl.java:66)
at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getDocs(ApiDocumentationController.java:117)
at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResourceList(ApiDocumentationController.java:130)
at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResources(ApiDocumentationController.java:32)

Update to Swagger 1.3.2

v1.3.2 Jan-16 2014

  • Added support for Jersey2
  • Simplified configuration for non web.xml
  • Fixes for Servlet integration
  • Added ApiInfo support for Play2
  • Model annotation fixes
  • Updates to OAuth2 support annotations to include scopes
  • OAuth2 server support
  • Fixes for custom model processor support

Overriding models

Hello, I'm trying to override models per https://github.com/wordnik/swagger-core/wiki/overriding-models but swagger doesn't seem to encounter and return overridden schema. And it seems that the controllers are always loaded prior to serializer being bootstrapped. I'm not sure if this is an issue or is it just my fault...

@component
public class BootstrapController implements ApplicationListener {
@OverRide
public void onApplicationEvent(ContextRefreshedEvent event) {
new DateSerializer();
}
}

Class Cast Exception with Generic Response type

15:27:32.212 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Could not complete request
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
    at com.wordnik.swagger.core.ApiPropertiesReader$.getDataType(ApiPropertiesReader.scala:97) ~[swagger-core_2.9.1-1.2.2.jar:1.2.2]
    at com.wordnik.swagger.core.ApiPropertiesReader$.getDataType(ApiPropertiesReader.scala:83) ~[swagger-core_2.9.1-1.2.2.jar:1.2.2]

This is specifically referencing the line below in the ApiPropertiesReader class.

} else if (!returnType.getClass.isAssignableFrom(classOf[ParameterizedTypeImpl]) && returnType.asInstanceOf[Class[_]].isArray) {

This is an issue because generics are necessary for us, it would be great if this could be resolved quickly or if you could possibly offer some workaround as we are big fans of Swagger and would love to use it.

This is what the class the exception is occurring on looks like:

@JsonSerialize
@JsonInclude(Include.NON_EMPTY)
public class PageDTO< T > implements Serializable
{
private static final long serialVersionUID = 1L;

private List< T > content;
private Long total;

public PageDTO()
{
content = new ArrayList< T >();
}

public PageDTO(T element)
{
content = new ArrayList< T >();
total = Long.valueOf(0);
if(element != null)
{
content.add(element);
total = Long.valueOf(1);
}
}

public PageDTO(List< T > content, Long total)
{
this.content = content;
this.total = total;
}

public List< T > getContent()
{
return content;
}

public Long getTotal()
{
return total;
}

public void setTotal(Long total)
{
this.total = total;
}

public void setContent(List< T > content)
{
this.content = content;
}

}

Sorry for the lack of code tags, I'm still new to the site and I couldn't get the < T > to display when I was using them.

I asked about this problem in issue #145 on Swagger-core but the person who was talking to me about it seemed to think it was related to this project so I've posted this here.

Issue Starting Application with swagger4spring-web dependency

Hi,

Facing issue while starting my application in tomcat after including the dependency.

com.knappsack swagger4spring-web 0.2.1-SNAPSHOT

This is the latest source code which I have downloaded.

Error is as follows :

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.AbstractMethodError: ch.qos.logback.classic.Logger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:272)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)

Could someone please help me out with this issue .

thx,
Yogesh

SLF4J framework bindings should not be specified as compile-time dependencies

The POM for swagger4spring-web specifies a compile-time dependency on the SLF4J frameworks 'logback-classic' and 'logback-core'.

The presence of the bindings for logback-* cause a conflict when an application (using swagger4spring-web) specifies an alternate SLF4J binding. This conflict can cause the application-specified SLF4J binding to be ignored in favor of the binding specified by swagger4spring-web.

The following excerpt from the SLF4J documentation (http://www.slf4j.org/codes.html#multiple_bindings) indicates why the compile-time bindings should be removed:

"Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways."

support controller interface implementation?

Hi all,

Here is my case
////////////////////controller interface////////////////////
@controller
@RequestMapping(value="testSample")
public interface IATest {
@RequestMapping(value = "OMGTest", method = RequestMethod.GET)
@ResponseStatus(value = HttpStatus.OK)
@responsebody
public Account accounts( Integer ID);
}
//////////////////concrete class////////////////////////////
public class OMGTest implements IATest {
public Account accounts( Integer ID){
return new Account(ID);
}
}
/////////////////////////////////////////////////////////////////////
I always get "UnexpectedException" when I link to
{localservice} /api/resourceList

Does swagger4spring-web support the above situation?
(i.e document out the class which implements the controller interface.)

Return type of List<T> does not display inner type

I have a method in my api that returns a List. In the generated JSON I see this:

{
 "path":"/api/properties",
   "description":"",
   "operations":  [
      {
         "httpMethod":"GET",
         "responseClass":"List",
         "nickname":"getAllProperties"
      }
   ]
}

Since the generated responseClass is a simple List, using swagger-ui it shows as:

List {
   empty (boolean, optional)
}

It would be great if the inner type was preserved.

"Upload file" button for the MultipartFile parameter

Hi,
We're using 0.3.1 version of swagger4spring, and for the request parameters that are of the org.springframework.web.multipart.MultipartFile type it doesn't show the "file upload" button. I've added the following line to the SpringMVCApiReader.scala file in the processDataType method:
case "org.springframework.web.multipart.MultipartFile" => "file"
and it seems to work, but I'm not sure if this is a correct way to go as basically it was just a quick fix to get it working.
This issue also exists in 0.3.2, haven't checked 0.3.3 as we're not using Spring 4 yet.

Allow the ability to set more than one package for controllers and models

Currently, only one package is allowed for setting the location of the model and controller classes. This assumes that a project has everything under the same package, but might not be the case. Add fields for "additional controller packages" and "additional model packages", so that swagger4spring-web can scan in multiple spots.

List<MyClass> is not display correctly

When I have a controller method that returns List in the documentation it says the "Response Class" is:

Model | Model Schema
List {
empty(boolean optional)
}

the controller method looks like this:
@RequestMapping(method = RequestMethod.GET)
@responsebody
public List< GroupMember > getMembers() {
... myCode...
}

Do you know why this could be?

Also, sorry this is a separate subject but you seem to be pretty responsive so I thought I would ask you, is there a way to gather the documentation from the JavaDocs in code? or do you have to use the @Api annotations?

Cannot follow instructions/configure ScalaObjectMapper

Using:

<mvc:annotation-driven>
    <mvc:message-converters>
        <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
            <property name="objectMapper">
                <bean class="com.knappsack.swagger4springweb.util.ScalaObjectMapper"/>
            </property>
        </bean>
    </mvc:message-converters>

redefines a RequestMappingHandlerAdapter, with the other instance configured by a third party dpeendency:

org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] is defined: expected single matching bean but found 2: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#1

Is there an alternative way to do this, e.g. programmatically? Wouldn't mind working on it for a pull request.

If i omit adding the config for ScalaObjectMapper calling resources

2014-02-15 12:31:43.067:WARN:oejs.ServletHandler:/apidoc/resourceList
com.thoughtworks.paranamer.ParameterNamesNotFoundException: Parameter names not found for create
    at com.thoughtworks.paranamer.BytecodeReadingParanamer$TypeCollector.getParameterNamesForMethod(BytecodeReadingParanamer.java:241)
    at com.thoughtworks.paranamer.BytecodeReadingParanamer$TypeCollector.access$300(BytecodeReadingParanamer.java:144)
    at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:104)
    at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:69)
    at com.knappsack.swagger4springweb.util.AnnotationUtils.getAnnotatedParameters(AnnotationUtils.java:83)
    at com.knappsack.swagger4springweb.parser.ApiParameterParser.getApiParameters(ApiParameterParser.java:38)
    at com.knappsack.swagger4springweb.parser.ApiOperationParser.getDocumentationOperation(ApiOperationParser.java:91)
    at com.knappsack.swagger4springweb.parser.ApiParserImpl.processMethods(ApiParserImpl.java:200)
    at com.knappsack.swagger4springweb.parser.ApiParserImpl.processControllers(ApiParserImpl.java:111)
    at com.knappsack.swagger4springweb.parser.ApiParserImpl.createApiListings(ApiParserImpl.java:89)
    at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getDocs(ApiDocumentationController.java:158)
    at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResourceList(ApiDocumentationController.java:172)
    at com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResources(ApiDocumentationController.java:42)

'required' not being added to params

I am using:

  • swagger4spring-web-0.3.2 (because production env uses Java 1.6)
  • Spring 4.0.2

My controllers get parsed correctly when simply using normal Spring annotations and swagger's @ApiOperation. However, I run into an issue when also using swagger's @Api annotation to add a description to my controller. The issue is that my required parameters in the controller aren't labeled as required anymore. I verify this by looking at the JSON that is produced in the resource list.

JSON snippet showing GET parameters for controller when using @Api as well as @ApiOperation:

...
"parameters": [{
    "name": "id",
    "description": "Subscription Id",
    "defaultValue": null,
    "required": false,
    "allowMultiple": false,
    "dataType": "string",
    "allowableValues": null,
    "paramType": "query",
    "paramAccess": null
},
{
    "name": "callback",
    "description": "Padding prefix for JSONP",
    "defaultValue": null,
    "required": false,
    "allowMultiple": false,
    "dataType": "string",
    "allowableValues": null,
    "paramType": "query",
    "paramAccess": null
}],
...

Here is the code for my controller:

@Controller
@RequestMapping(value = "/tag")
@Api(value="tag", description="Tag Controller")
public class TagController extends BasicController {
    
    @Autowired
    SubscriptionTagService subscriptionTagService;
    
    @RequestMapping(method=RequestMethod.POST)
    @ApiOperation(value = "Add a tag", 
                  notes="Add a tag to a subscrition")
    public void addTag(@ApiParam(value="Subscription Id") @RequestParam(value="id") String subscriptionId,
                       @ApiParam(value="Tag name") @RequestParam(value="tag") String tagName,
                       @ApiParam(value="Padding prefix for JSONP") @RequestParam(value="callback", required=false) String callback,
                       HttpServletRequest request) {
        String username = getIdFromRequest(request);
        subscriptionTagService.add(tagName, username, subscriptionId);
    }
    
    @RequestMapping(method=RequestMethod.GET,
                    produces=MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "Get subscription tags", 
                  notes = "Gets the tags of a user's subscription",
                  response = Tag.class)
    public @ResponseBody List getTags(@ApiParam(value="Subscription Id") @RequestParam(value="id") String subscriptionId,
                                           @ApiParam(value="Padding prefix for JSONP") @RequestParam(value="callback", required=false) String callback,
                                           HttpServletRequest request) {
        
        String username = getIdFromRequest(request);
        return subscriptionTagService.getSubscriptionTags(subscriptionId, username);
    }   
}

When I comment out @Api(value="tag", description="Tag Controller") the required parameters are correctly labeled.

Why would @Api be causing all parameters to have required = "false"? I have even tried to explicitly mark subscriptionId as required, but that doesn't have any effect.

SpringDataRest

The Current Version doesn't work well with SpringDataRest. Any plans to support SpringDataRest ?

Request method from a class level @RequestMapping annotation is not honored

SwaggerOperation findOne is missing method is reported while the request method should be inherited from the class declaration.
I believe there is even a default (GET) when no @RequestMappingspecifies a method.

@Controller
@ExposesResourceFor(UserAccountResource.class)
@RequestMapping(value = UserAccountController.REQUEST_MAPPING_PATH, produces = {"application/json"}, method = RequestMethod.GET)
public class UserAccountController {
    @RequestMapping(value = "/{reference}")
    public ResponseEntity<UserAccountResource> findOne(@NonNull @PathVariable UUID reference) {

Accessing JSON files

Hello, excuse me if this is dumb or obvious question but I'm still new to swagger. For the swagger docs that I am developing for the company I work for I need to be able save off the Jsons that swagger generates while scanning a project annotated with tags. It doesn't look like they are saved into the project locally but maybe there is a spot in the javascript of the HTML files that I can intercept them?

@ApiModelProperty

Hi, I use your great module in my Spring MVC/AngularJS application. I'd like to annotate my models with @ApiModelProperty especially the enum fields. Something like:

@Enumerated(EnumType.STRING)
@ApiModelProperty(value = "Location category", required=true, allowableValues = "INTERNAL, EXTERNAL")
private LocationCategory locationCategory

The goal is to be able to access a meta model on client side through REST-API so I know which entries can be made in locationCategory. Unfortunately it seems that this annotation is not supported?

cannot have multiple controllers bound to the same URL

I have multiple controllers which are bound to the same base url

@Controller 
@RequestMapping("/reservation")
public class ReservationController {
    @RequestMapping("/")
    ...
}

@Controller 
@RequestMapping("/reservation")
public class ReservationFormController {
    @RequestMapping("/edit")
    ...
}

In such a case the 2nd controller is ignored,
the reason seems to be that the api listings are stored in a hash map based on their URLs. So newer controllers will override the apilisting created for a previous controller.

IMHO the apilistings need to be merged.

Custom property names for @RequestBody

My @requestbody class looks like this:

  public static class OrderRequest {
    @JsonProperty("product-offering-id")
    public String productOfferingId;
    @JsonProperty("initial-state")
    public String initialState;
  }

Swagger generates such model:

OrderRequest {
productOfferingId (string, optional),
initialState (string, optional)
}

and model schema is:

{
"productOfferingId":"",
"initialState":""
}

Can Swagger generate correct names?

Scanning packages in jar

Hi,

I managed to set up the swagger4springweb-example project with success, but I didn't manage to scan the controller and model packages when they are in a dependency and not in the source spath.

With the debugger I had a look at the code used to scan the classes (which I am not really able to understand), and I figured out that the ClassLoader used scan the classes in /WEB-INF/classes/, so I assume that it is mendatory to put the scanned classes in the source path of the swagger4spring project. Is there a way to scan classes in a dependency ?

That would be really interesting for me as the webservice and model layers are in separated projects.

Thanks,

Julien

@Api position not work.

modified ApiParserImpl.java code

public ResourceListing getResourceListing(Map<String, ApiListing> apiListingMap) {

    List<ApiListingReference> apiListingReferences = new ArrayList<ApiListingReference>();
    for (String key : apiListingMap.keySet()) {
        ApiListing apiListing = apiListingMap.get(key);
        String docPath = "/doc"; //servletPath + "/doc"; //"/api/doc";
        ApiListingReference apiListingReference = new ApiListingReference(docPath + key, apiListing.description(),
                apiListing.position());

        apiListingReferences.add(apiListingReference);
    }

    Collections.sort(apiListingReferences, new Comparator<ApiListingReference>() {
        @Override
        public int compare(ApiListingReference o1, ApiListingReference o2) {
            if (o1.position() == o2.position())
                return 0;
            else if (o1.position() < o2.position())
                return -1;
            else if (o1.position() > o2.position())
                return 1;
            return 0;
        }
    });

    return new ResourceListing(apiVersion, swaggerVersion, JavaToScalaUtil.toScalaList(apiListingReferences), null,
            swaggerConfig.info());
}

.
.
.

    return new ApiListing(apiVersion, swaggerVersion, basePath, resourcePath, null, null, null, null, null, null,
            null, controllerApi.position());

Upgrade from 0.3.1 to 0.3.2 (or 0.3.3) causes failure on methods using wildcards

After the upgrade, went from everything working to getting this exception: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.WildcardTypeImpl cannot be cast to java.lang.Class

Did some troubleshooting and determined it now fails on two methods I have with a signature like:

@responsebody
public List<?> foo(.....)

If I comment these out in the newer 0.3.2+ it again works. Failure is from this line:

ApiOperationParser:54 - documentationOperation.setResponseClass((Class<?>) type);

Breaking change was made in this commit:
27dd93d

If I simply take out the generics on those methods, changing to:
@responsebody
public List foo(.....)

Then everything works again also.

Multiple controllers sharing the same request mapping path mutually exclude each other from showing up in the documentation

Two controllers mapping to the same base URL are not recognized by swagger4spring (0.3.3).
Controller 1: /dictionaries/userAccount

@RestController
@RequestMapping(value = "/dictionaries", produces = {"application/json"})
public class UserAccountDictionaryController {
    @RequestMapping(value = "/userAccount", method = RequestMethod.GET)
    public ResponseEntity<ResourceMetadata> resourceMetadata()

Controller 2: /dictionaries/userGroup

@RestController
@RequestMapping(value = "/dictionaries", produces = {"application/json"})
public class UserGroupDictionaryController {
    @RequestMapping(value = "/userGroup", method = RequestMethod.GET)
    public ResponseEntity<ResourceMetadata> resourceMetadata()

This will result in just one controller to be included. I guess from the internal implementation, one map entry replaces the other and so forth. They probably need to be merged together.

Heroku is not allowed by Access-Control-Allow-Origin.

I have a Spring MVC swagger project that is working on localhost but when I deploy it to Heroku I get the following error:

XMLHttpRequest cannot load http://force-com-rest-swagger.herokuapp.com/api/doc/api/v1/account. Origin https://force-com-rest-swagger.herokuapp.com is not allowed by Access-Control-Allow-Origin.

Here is my Swagger js config:

$(document).ready(function () {

    displaySwaggerDocuments();

    function displaySwaggerDocuments() {
        var url = '<c:url value="/api/resourceList"/>';
        window.swaggerUi = new SwaggerUi({
            discoveryUrl: url,
            dom_id: "swagger-ui-container",
            supportHeaderParams: false,
            supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
            apiKey: "",
            onComplete: function (swaggerApi, swaggerUi) {
                if (console) {
                    console.log("Loaded SwaggerUI")
                    console.log(swaggerApi);
                    console.log(swaggerUi);
                }
                $('pre code').each(function (i, e) {
                    hljs.highlightBlock(e)
                });
            },
            onFailure: function (data) {
                if (console) {
                    console.log("Unable to Load SwaggerUI");
                    console.log(data);
                }
            },
            docExpansion: "none"
        });

        window.swaggerUi.load();
    }
});

Any suggestions?

I tried to set my discoveryUrl to http://force-com-rest-swagger.herokuapp.com/ and also supportHeaderParams=true but it still gives the same error.

Any suggestions?

Request mapping "servletPath" issues

When following the instructions here: https://github.com/wkennedy/swagger4spring-web to override the request mapping ("Alternative Implementation") I found that though the resourceList request did, in fact, work with the "/documentation" root, the returned Documentation entries still referred to the default "/api" root.

The ApiDocumentationController tries to override this on line 155, but it uses the request.getServletPath() where it should (most likely) use request.getPathInfo().

In order to work around this flaw, I wrapped the HttpServletRequest and returned the expected root ("/documentation") via the wrapper's request.getServletPath() method.

Controllers with lambda left out.

Reflections throws an exceptions when trying to scan a class with lambda expressions, causing it to be left out of the documentation.

Caused by: org.reflections.ReflectionsException: could not create class file from EventController.class
    at org.reflections.adapters.JavassistAdapter.createClassObject(JavassistAdapter.java:128) ~[JavassistAdapter.class:na]
    at org.reflections.adapters.JavassistAdapter.getOfCreateClassObject(JavassistAdapter.java:118) ~[JavassistAdapter.class:na]
    at org.reflections.adapters.JavassistAdapter.getOfCreateClassObject(JavassistAdapter.java:26) ~[JavassistAdapter.class:na]
    at org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:27) ~[AbstractScanner.class:na]
    ... 85 common frames omitted
Caused by: java.io.IOException: invalid constant type: 18
    at javassist.bytecode.ConstPool.readOne(ConstPool.java:1090) ~[ConstPool.class:na]
    at javassist.bytecode.ConstPool.read(ConstPool.java:1033) ~[ConstPool.class:na]
    at javassist.bytecode.ConstPool.<init>(ConstPool.java:149) ~[ConstPool.class:na]
    at javassist.bytecode.ClassFile.read(ClassFile.java:737) ~[ClassFile.class:na]
    at javassist.bytecode.ClassFile.<init>(ClassFile.java:108) ~[ClassFile.class:na]
    at org.reflections.adapters.JavassistAdapter.createClassObject(JavassistAdapter.java:126) ~[JavassistAdapter.class:na]

What are the preconditions for having a response properly show up in the documentation?

I have a controller that basically is shown in the swagger UI. However, its response type is not resolved properly. Only the fully qualified class name is shown without the structural drill-down on the TestResource type properties.

Response Class
Model  Model Schema
web.controller.UserGroupController$TestResource
@Controller
@RequestMapping(value = UserGroupController.REQUEST_MAPPING_PATH, produces = {"application/json"})
public class UserGroupController {
    public static final String REQUEST_MAPPING_PATH = "/entities";

    @RequestMapping(value = "/{reference}", method = RequestMethod.GET, produces = "application/json")
    @ApiOperation(value = "Find an entity", response = TestResource.class, produces = "application/json", httpMethod = "GET")
    public @ResponseBody TestResource entity(@NonNull @PathVariable UUID reference) {
        return new TestResource(reference.toString());
    }
    @ApiModel(value = "Test resource")
    public static class TestResource {
        @ApiModelProperty(value = "Name")
        private String name;
        public TestResource(String name) {
            this.name = name;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
    }
}

The documentation controller performs the setup for the packages:

@Controller
@RequestMapping(value = DocumentationController.REQUEST_MAPPING_PATH)
public class DocumentationController extends ApiDocumentationController {
    public static final String REQUEST_MAPPING_PATH = "/documentation";
    public DocumentationController() {
        setBaseControllerPackage("web.controller");
        setBaseModelPackage("web.controller");
        setAdditionalModelPackages(Arrays.asList(new String[] {"web.controller"}));
        setApiVersion("TODO");
    }

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String documentation() {
        return "documentation";
    }
}

I'm using the 0.3.1 release.

Content Type from a class level @RequestMapping annotation is not honored

Given a controller class that already has a class level @RequestMapping, when it defines a content type (e.g. produces = {"application/json"}, it is not honored.

@ExposesResourceFor(UserGroupResource.class)
@RequestMapping(value = "/userGroups", produces = {"application/json"})
public class UserGroupController {

Haven't tested with consumes though.

abnormal response header and response body are displayed

When I use the swagger to send a multi-part request to upload some files, response info displayed in page becomes abnormal. Response headers are messy, and no content in response body, as shown in the snapshot. I guess maybe inputstream of response info is not correctly handled by code somewhere. Sorry for some Chinese words in the snapshot; "选择文件" means "select file". If you can reproduce this problem, then this might be a common bug.
capture3

JBOSS empty API listing

swagger-api/swagger-core#463

your depending on a version of org.reflections that does not play friendly with jboss, causing empty API listings

the Recommendation is to change to

org.reflections
reflections
0.9.9-RC1

However When we did that we got a exception thrown, in your code

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.reflections.Reflections.getAllMethods(Ljava/lang/Class;Lcom/google/common/base/Predicate;)Ljava/util/Set;
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1284)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:965)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:155)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
root cause

java.lang.NoSuchMethodError: org.reflections.Reflections.getAllMethods(Ljava/lang/Class;Lcom/google/common/base/Predicate;)Ljava/util/Set;
com.knappsack.swagger4springweb.parser.ApiParserImpl.processControllers(ApiParserImpl.java:124)
com.knappsack.swagger4springweb.parser.ApiParserImpl.createApiListings(ApiParserImpl.java:114)
com.knappsack.swagger4springweb.controller.ApiDocumentationController.getDocs(ApiDocumentationController.java:104)
com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResourceList(ApiDocumentationController.java:118)
com.knappsack.swagger4springweb.controller.ApiDocumentationController.getResources(ApiDocumentationController.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:214)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:155)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)

Any idea about processing java.lang.Object failed?

By my RESTful service, i met following issue which casue the model-schema result in missing many models.

converter.ModelPropertyParser - processing class class java.lang.Object
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - processing method public final void java.lang.Object.wait() throws java.lang.InterruptedException
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - processing method public java.lang.String java.lang.Object.toString()
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - processing method public native int java.lang.Object.hashCode()
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - processing method public final native java.lang.Class java.lang.Object.getClass()
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - inspecting null
17:46:50.575 [http-8080-6] DEBUG c.w.s.converter.ModelPropertyParser - skipping class

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.