Releases: phiz71/vertx-swagger
Vert.X Swagger 1.6.0
New features
#86 adding the possibility to generate JsonObject instead of POJO
It is now possible to choose between POJO or JsonObject to generate model classes.
A new CLI option has been created for this -DjsonObjectModelGeneration=true
Contributions
#93 - File upload not working (@petebuletza)
Support vertx-web 3.5 (@bignacio )
Vert.X Swagger 1.5.0
Breaking Changes
Since it is now possible to add headers to the responses (even if it is an error), former static final XXXApiExceptions are now created with a method.
//before
...
public static final StoreApiException Store_deleteOrder_400_Exception = new StoreApiException(400, "Invalid ID supplied");
...
//after
..
public static StoreApiException StoreApi_deleteOrder_400_createException() {
return new StoreApiException(400, "Invalid ID supplied");
}
...For the same reason, and to allow methods of XXXApiImpl to return headers, all POJO have been included into a ResourceResponse<T> class. This class looks like this :
public class ResourceResponse<T> {
MultiMap headers;
T response;
...
}And `XXXApi``` have been modified like this :
//Async version before
void findPetsByStatus(List<String> status, User user, Handler<AsyncResult<List<Pet>>> handler);
//Async version after
void findPetsByStatus(List<String> status, User user, Handler<AsyncResult<ResourceResponse<List<Pet>>>> handler);
...
//Rx version before
public Single<List<Pet>> findPetsByStatus(List<String> status, User user);
//Rx version after
public Single<ResourceResponse<List<Pet>>> findPetsByStatus(List<String> status, User user);
...
/** and Completable have been replaced by ResourceResponse<Void>**/New features
#70 (@lopesmcc) & #79
It is now possible to return headers to the client from XXXAPIImpl.
Headers from the Swagger specification are available in XXXAPIHeader and can be returned whether the API send a 200 or an error.
#85 : The Swagger java object is now accessible throughout the server code, thanks to a SwaggerManager singleton which is initialize in the Swagger-Router.
Contributions
(Thanks @gokhanakgul)
- a
.swagger-codegen-ignorefile is generated - add execution with config file capability (
MainApiVerticle)+generation of aconfig.jsonfile - a startup script is now generated
run-with-config.sh - add a CLIOption to generate
XXXApiImpl. Useful when it is the first time your project is generated.
-DapiImplGeneration=true
Fixes
#74 : Enum Model generation is broken
#78 : Generated code for query parameters throws exception when parameter is not prodived :
- It now uses "default value" of a parameter when it is extracted in the router.
XXXApiVerticleare now generated in a different way if a parameter is not required
Vert.X Swagger 1.4.0
#22 Support swagger security definitions (Many thanks to @lopesmcc !!)
- Handling of swagger security definitions
- warn if a provided authProvider is not found
- Propagate User to API operations that use authentication
- User Rx User when Rx is enabled
- Adding 'user' as a reserved word to avoid conflict with the io.vertx.ext.auth.User
Others Issues resolved
- #46 Change rootPackage to invokerPackage instead (@lopesmcc)
- #55 TypeReference is used with the {{{dataType}}} parameter wether it is a String list or a POJO List.
- #57 On SwaggerRouter, request headers have been added to DeliveryOptions instead of replacing the existing ones
- #61 Fixing
UUIDmanagement inXXXAPIVerticle - #63 MainApiException extends RuntimeException instead of Exception (@lopesmcc)
- #64 Use fluent setters in Models
Others
- fixing sonar "code smells"
- templates corrections : change value by the parameter when calling manageError
- regenerating samples since last modifications
Vert.X Swagger 1.3.0
Breaking change : the Rx version of SwaggerRouter has been moved to a new package (com.github.phiz71.rxjava.vertx.swagger.router)
Code refactoring of the mustache templates (#44)
- extract a "manageError" function and a "log" function.
- Both are used by Rx & Async version templates.
- ManageError is also use in the catch section of consumers.
Check existence of custom DeliveryOptions function before attempting to apply it (#41]
MainApiVerticle generation is now optional (fixing #37)
Fixing extractors
- fixing all parameter extractors
- simplify PathParameterExtractor :
According to Swagger Specification, path parameters are always required.
And as the PathParameterExtractor is activated only if the request contains a path parameter, requirement tests are no longer needed - adding tests
- cleaning old tests
- managing "allowEmptyValue" option for parameters
Others
- changing .travis.yml : sonarcube -> sonarcloud
- moving "manageHeaders" in swagger router, since response without body can also have headers
- propagate request headers to Verticle ; useful for instance if it is needed to handle different CONTENT_TYPE
- moving Rx version of swaggerRouter
- code cleaning
Vert.X Swagger 1.2.0
Breaking change : -DfutureGeneration option is no longer supported as it was replaced by -DrxInterface option. See change log below.
Respect basePath of Swagger API spec (#35 -> resolves #39)
- Change Router to serve endpoints under the basepath, if present.
Change generated API and verticles to be asynchronous. (#34 -> resolves #33)
- Use void methods with Handler<AsyncResult>> as last arg
- Propagate API exceptions correctly
- Handle non-existent API results by replying null to the eventbus message.
- improved error logging
- Formatted mustache template for easier reading
Generation of RXified API (#36 -> resolves #33)
- changing FUTURE_GENERATION option to RX_INTERFACE
- creating specific templates for RX
- update test of RX sample
- renaming onSuccess & onError to result & error
- using Completable for methods returning void
Other changes
- using vertx 3.4.1 in generated servers
- log only unexpected errors in generated servers
Vert.X Swagger 1.1.0
Release 1.1.0 (#32)
-
- exception generation from swagger file
- adding some checking on http status code
-
- managing headers from eventBus messages
- adding specific header code to manage http response
-
Future generation (#27)
- adding a CLIOption to generate Future<>
-
adapatation of Future generation with error handling
Vert.X Swagger 1.0.0
First release of the Vert.X Swagger Router and the Vert.X Swagger Codegen.