wkennedy / swagger4spring-web

Swagger support for Spring MVC
89 stars 46 forks source link

Bugs fixing and minor improvements #37

Closed dayman closed 10 years ago

dayman commented 10 years ago

ApiOperationParser

  1. A bug when we have @ApiOperation without "method" specified. Then value is taken from httpMethod (without trimming). As a result we get "POST ", which is not recognized by Swagger UI.
  2. A bug when we have @ApiOperation without "produces" or "consumes" specifed. Then code populates this arrays with "" value and then in Swagger UI we see "Produces: ['']"
  3. ApiError renamed to ApiResponse in code
  4. Validation logic partially moved to DocumentationOperation (as well as toScalaOperation())

ApiModelParser, ApiParserImpl

  1. A bug with missing models. Some of the models were ignored by parsing and Swagger UI had no ability to show them to user. Models parsing logic was moved to ApiUtils class so that both of classes mentioned could use it. In future, probably, it is better to merge this "model parsing logic" and remove baseModelPackage property, because it seems that this property is not necessary.
  2. Work with Generics was improved. Code now correctly parses generic return types: List -> List[SomeClass] ContainerClass -> ContainerClass[InnerClass]

    My Fork of Swagger UI renders such response types correctly https://github.com/wordnik/swagger-ui/pull/401

    Elements with only one generic would be processed.

wkennedy commented 10 years ago

These changes look good, dayman. Thanks!