diff --git a/bin/openapi3/javascript-closure-angular.sh b/bin/openapi3/javascript-closure-angular.sh new file mode 100755 index 00000000000..29ed86eb4b4 --- /dev/null +++ b/bin/openapi3/javascript-closure-angular.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l javascript-closure-angular -o samples/client/petstore/javascript-closure-angular $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION b/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION index 7fea99011a6..096bf47efe3 100644 --- a/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-closure-angular/.swagger-codegen/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js index 3d25f137ff6..6e6bcfebfea 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js @@ -5,10 +5,10 @@ * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated by: io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen + * Generated by: org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen */ /** - * @license Apache 2.0 + * @license Apache-2.0 * http://www.apache.org/licenses/LICENSE-2.0.html */ @@ -47,11 +47,11 @@ API.Client.PetApi.$inject = ['$http', '$httpParamSerializer', '$injector']; /** * Add a new pet to the store * - * @param {!Pet} body Pet object that needs to be added to the store + * @param {!Pet} pet Pet object that needs to be added to the store * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.addPet = function(pet, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet'; @@ -60,16 +60,16 @@ API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling addPet'); + // verify required parameter 'pet' is set + if (!pet) { + throw new Error('Missing required parameter pet when calling addPet'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: pet, params: queryParameters, headers: headerParams }; @@ -241,11 +241,11 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar /** * Update an existing pet * - * @param {!Pet} body Pet object that needs to be added to the store + * @param {!Pet} pet Pet object that needs to be added to the store * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) { +API.Client.PetApi.prototype.updatePet = function(pet, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/pet'; @@ -254,16 +254,16 @@ API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParam /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling updatePet'); + // verify required parameter 'pet' is set + if (!pet) { + throw new Error('Missing required parameter pet when calling updatePet'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: body, + data: pet, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js index 2b780ca475d..b75581a8c97 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js @@ -5,10 +5,10 @@ * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated by: io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen + * Generated by: org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen */ /** - * @license Apache 2.0 + * @license Apache-2.0 * http://www.apache.org/licenses/LICENSE-2.0.html */ @@ -151,11 +151,11 @@ API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequ /** * Place an order for a pet * - * @param {!Order} body order placed for purchasing the pet + * @param {!Order} order order placed for purchasing the pet * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestParams) { +API.Client.StoreApi.prototype.placeOrder = function(order, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/store/order'; @@ -164,16 +164,16 @@ API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestPa /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling placeOrder'); + // verify required parameter 'order' is set + if (!order) { + throw new Error('Missing required parameter order when calling placeOrder'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: order, params: queryParameters, headers: headerParams }; diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js index 0f64823bb97..a84cda7a946 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js @@ -5,10 +5,10 @@ * * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated by: io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen + * Generated by: org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen */ /** - * @license Apache 2.0 + * @license Apache-2.0 * http://www.apache.org/licenses/LICENSE-2.0.html */ @@ -46,11 +46,11 @@ API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector']; /** * Create user * This can only be done by the logged in user. - * @param {!User} body Created user object + * @param {!User} user Created user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUser = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user'; @@ -59,16 +59,16 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUser'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -83,11 +83,11 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar /** * Creates list of users with given input array * - * @param {!Array} body List of user object + * @param {!Array} user List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithArrayInput = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithArray'; @@ -96,16 +96,16 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUsersWithArrayInput'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUsersWithArrayInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -120,11 +120,11 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr /** * Creates list of users with given input array * - * @param {!Array} body List of user object + * @param {!Array} user List of user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.createUsersWithListInput = function(user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/createWithList'; @@ -133,16 +133,16 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extra /** @type {!Object} */ var headerParams = angular.extend({}, this.defaultHeaders_); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling createUsersWithListInput'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling createUsersWithListInput'); } /** @type {!Object} */ var httpRequestParams = { method: 'POST', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams }; @@ -194,7 +194,7 @@ API.Client.UserApi.prototype.deleteUser = function(username, opt_extraHttpReques /** * Get user by user name * - * @param {!string} username The name that needs to be fetched. Use user1 for testing. + * @param {!string} username The name that needs to be fetched. Use user1 for testing. * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ @@ -312,11 +312,11 @@ API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) { * Updated user * This can only be done by the logged in user. * @param {!string} username name that need to be deleted - * @param {!User} body Updated user object + * @param {!User} user Updated user object * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. * @return {!angular.$q.Promise} */ -API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttpRequestParams) { +API.Client.UserApi.prototype.updateUser = function(username, user, opt_extraHttpRequestParams) { /** @const {string} */ var path = this.basePath_ + '/user/{username}' .replace('{' + 'username' + '}', String(username)); @@ -330,16 +330,16 @@ API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttp if (!username) { throw new Error('Missing required parameter username when calling updateUser'); } - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling updateUser'); + // verify required parameter 'user' is set + if (!user) { + throw new Error('Missing required parameter user when calling updateUser'); } /** @type {!Object} */ var httpRequestParams = { method: 'PUT', url: path, json: true, - data: body, + data: user, params: queryParameters, headers: headerParams };