From b1ccaf69ac68a9b7a4e3067cc6c20592bed20739 Mon Sep 17 00:00:00 2001 From: Michael Langford Date: Fri, 26 May 2017 12:27:11 -0400 Subject: [PATCH] Updates http-client dependency to correctly handles certificates (#5707) * Updates http-client dependency to one that correctly handles certificates This is important as amazon AWS gateway and several other types of certificates will not work correctly due to the old java library used by the 2.0.0 version of http-client. * Runs the petstore updates switch for clojure * Runs the petstore updates switch for clojure --- .../main/resources/clojure/project.mustache | 2 +- samples/client/petstore/clojure/project.clj | 4 +- .../clojure/src/swagger_petstore/api/pet.clj | 111 +++++++-------- .../src/swagger_petstore/api/store.clj | 32 ++--- .../clojure/src/swagger_petstore/api/user.clj | 134 ++++++++---------- 5 files changed, 132 insertions(+), 151 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/clojure/project.mustache b/modules/swagger-codegen/src/main/resources/clojure/project.mustache index df83142e428..0fe990d02c8 100644 --- a/modules/swagger-codegen/src/main/resources/clojure/project.mustache +++ b/modules/swagger-codegen/src/main/resources/clojure/project.mustache @@ -4,5 +4,5 @@ :license {:name "<&projectLicenseName>"<#projectLicenseUrl> :url "<&projectLicenseUrl>"} :dependencies [[org.clojure/clojure "1.7.0"] - [clj-http "2.0.0"] + [clj-http "3.6.0"] [cheshire "5.5.0"]]) diff --git a/samples/client/petstore/clojure/project.clj b/samples/client/petstore/clojure/project.clj index 34dcb2d99a7..e64d9ef7447 100644 --- a/samples/client/petstore/clojure/project.clj +++ b/samples/client/petstore/clojure/project.clj @@ -1,7 +1,7 @@ (defproject swagger-petstore "1.0.0" - :description "This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters" + :description "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." :license {:name "Apache 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.7.0"] - [clj-http "2.0.0"] + [clj-http "3.6.0"] [cheshire "5.5.0"]]) diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj index 344ea3bb1f8..92ab5e13218 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/pet.clj @@ -5,24 +5,22 @@ (defn add-pet-with-http-info "Add a new pet to the store " - ([] (add-pet-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/pet" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types ["application/json" "application/xml"] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) + [body ] + (call-api "/pet" :post + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] + :auth-names ["petstore_auth"]})) (defn add-pet "Add a new pet to the store " - ([] (add-pet nil)) - ([optional-params] - (:data (add-pet-with-http-info optional-params)))) + [body ] + (:data (add-pet-with-http-info body))) (defn delete-pet-with-http-info "Deletes a pet @@ -35,7 +33,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names ["petstore_auth"]}))) (defn delete-pet @@ -48,48 +46,44 @@ (defn find-pets-by-status-with-http-info "Finds Pets by status Multiple status values can be provided with comma separated strings" - ([] (find-pets-by-status-with-http-info nil)) - ([{:keys [status ]}] - (call-api "/pet/findByStatus" :get - {:path-params {} - :header-params {} - :query-params {"status" (with-collection-format status :multi) } - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) + [status ] + (call-api "/pet/findByStatus" :get + {:path-params {} + :header-params {} + :query-params {"status" (with-collection-format status :csv) } + :form-params {} + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names ["petstore_auth"]})) (defn find-pets-by-status "Finds Pets by status Multiple status values can be provided with comma separated strings" - ([] (find-pets-by-status nil)) - ([optional-params] - (:data (find-pets-by-status-with-http-info optional-params)))) + [status ] + (:data (find-pets-by-status-with-http-info status))) (defn find-pets-by-tags-with-http-info "Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." - ([] (find-pets-by-tags-with-http-info nil)) - ([{:keys [tags ]}] - (call-api "/pet/findByTags" :get - {:path-params {} - :header-params {} - :query-params {"tags" (with-collection-format tags :multi) } - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) + [tags ] + (call-api "/pet/findByTags" :get + {:path-params {} + :header-params {} + :query-params {"tags" (with-collection-format tags :csv) } + :form-params {} + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names ["petstore_auth"]})) (defn find-pets-by-tags "Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing." - ([] (find-pets-by-tags nil)) - ([optional-params] - (:data (find-pets-by-tags-with-http-info optional-params)))) + [tags ] + (:data (find-pets-by-tags-with-http-info tags))) (defn get-pet-by-id-with-http-info "Find pet by ID - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" + Returns a single pet" [pet-id ] (call-api "/pet/{petId}" :get {:path-params {"petId" pet-id } @@ -97,36 +91,35 @@ :query-params {} :form-params {} :content-types [] + :accepts ["application/json" "application/xml"] :auth-names ["api_key" "petstore_auth"]})) (defn get-pet-by-id "Find pet by ID - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions" + Returns a single pet" [pet-id ] (:data (get-pet-by-id-with-http-info pet-id))) (defn update-pet-with-http-info "Update an existing pet " - ([] (update-pet-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/pet" :put - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types ["application/json" "application/xml"] - :accepts ["application/json" "application/xml"] - :auth-names ["petstore_auth"]}))) + [body ] + (call-api "/pet" :put + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] + :auth-names ["petstore_auth"]})) (defn update-pet "Update an existing pet " - ([] (update-pet nil)) - ([optional-params] - (:data (update-pet-with-http-info optional-params)))) + [body ] + (:data (update-pet-with-http-info body))) (defn update-pet-with-form-with-http-info "Updates a pet in the store with form data @@ -139,7 +132,7 @@ :query-params {} :form-params {"name" name "status" status } :content-types ["application/x-www-form-urlencoded"] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names ["petstore_auth"]}))) (defn update-pet-with-form @@ -160,7 +153,7 @@ :query-params {} :form-params {"additionalMetadata" additional-metadata "file" file } :content-types ["multipart/form-data"] - :accepts ["application/json" "application/xml"] + :accepts ["application/json"] :auth-names ["petstore_auth"]}))) (defn upload-file diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj index 04d185a8086..0e1bf23f41a 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/store.clj @@ -12,7 +12,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names []})) (defn delete-order @@ -31,7 +31,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/json"] :auth-names ["api_key"]})) (defn get-inventory @@ -50,7 +50,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names []})) (defn get-order-by-id @@ -62,22 +62,20 @@ (defn place-order-with-http-info "Place an order for a pet " - ([] (place-order-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/store/order" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [body ] + (call-api "/store/order" :post + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn place-order "Place an order for a pet " - ([] (place-order nil)) - ([optional-params] - (:data (place-order-with-http-info optional-params)))) + [body ] + (:data (place-order-with-http-info body))) diff --git a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj index 26e3dffc624..a57846f44c4 100644 --- a/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/swagger_petstore/api/user.clj @@ -5,68 +5,62 @@ (defn create-user-with-http-info "Create user This can only be done by the logged in user." - ([] (create-user-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/user" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [body ] + (call-api "/user" :post + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn create-user "Create user This can only be done by the logged in user." - ([] (create-user nil)) - ([optional-params] - (:data (create-user-with-http-info optional-params)))) + [body ] + (:data (create-user-with-http-info body))) (defn create-users-with-array-input-with-http-info "Creates list of users with given input array " - ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/user/createWithArray" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [body ] + (call-api "/user/createWithArray" :post + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn create-users-with-array-input "Creates list of users with given input array " - ([] (create-users-with-array-input nil)) - ([optional-params] - (:data (create-users-with-array-input-with-http-info optional-params)))) + [body ] + (:data (create-users-with-array-input-with-http-info body))) (defn create-users-with-list-input-with-http-info "Creates list of users with given input array " - ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [body ]}] - (call-api "/user/createWithList" :post - {:path-params {} - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [body ] + (call-api "/user/createWithList" :post + {:path-params {} + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn create-users-with-list-input "Creates list of users with given input array " - ([] (create-users-with-list-input nil)) - ([optional-params] - (:data (create-users-with-list-input-with-http-info optional-params)))) + [body ] + (:data (create-users-with-list-input-with-http-info body))) (defn delete-user-with-http-info "Delete user @@ -78,7 +72,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names []})) (defn delete-user @@ -97,7 +91,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names []})) (defn get-user-by-name @@ -109,23 +103,21 @@ (defn login-user-with-http-info "Logs user into the system " - ([] (login-user-with-http-info nil)) - ([{:keys [username password ]}] - (call-api "/user/login" :get - {:path-params {} - :header-params {} - :query-params {"username" username "password" password } - :form-params {} - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [username password ] + (call-api "/user/login" :get + {:path-params {} + :header-params {} + :query-params {"username" username "password" password } + :form-params {} + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn login-user "Logs user into the system " - ([] (login-user nil)) - ([optional-params] - (:data (login-user-with-http-info optional-params)))) + [username password ] + (:data (login-user-with-http-info username password))) (defn logout-user-with-http-info "Logs out current logged in user session @@ -137,7 +129,7 @@ :query-params {} :form-params {} :content-types [] - :accepts ["application/json" "application/xml"] + :accepts ["application/xml" "application/json"] :auth-names []})) (defn logout-user @@ -149,22 +141,20 @@ (defn update-user-with-http-info "Updated user This can only be done by the logged in user." - ([username ] (update-user-with-http-info username nil)) - ([username {:keys [body ]}] - (call-api "/user/{username}" :put - {:path-params {"username" username } - :header-params {} - :query-params {} - :form-params {} - :body-param body - :content-types [] - :accepts ["application/json" "application/xml"] - :auth-names []}))) + [username body ] + (call-api "/user/{username}" :put + {:path-params {"username" username } + :header-params {} + :query-params {} + :form-params {} + :body-param body + :content-types [] + :accepts ["application/xml" "application/json"] + :auth-names []})) (defn update-user "Updated user This can only be done by the logged in user." - ([username ] (update-user username nil)) - ([username optional-params] - (:data (update-user-with-http-info username optional-params)))) + [username body ] + (:data (update-user-with-http-info username body)))