[Clojure] Fix tests: stop dashizing props names (#1310)

* [Clojure] Fix tests: stop dashizing props names

* [Clojure] Remove jdk7 tests
This commit is contained in:
Fabrizio Ferrai 2018-10-25 07:19:52 +03:00 committed by William Cheng
parent eccab2c025
commit bbfaa90242
7 changed files with 44 additions and 46 deletions

View File

@ -321,7 +321,6 @@ public class ClojureClientCodegen extends DefaultCodegen implements CodegenConfi
@Override
public String toVarName(String name) {
name = name.replaceAll("[^a-zA-Z0-9_-]+", ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
name = org.openapitools.codegen.utils.StringUtils.dashize(name);
return name;
}

View File

@ -1161,7 +1161,6 @@
<module>samples/client/petstore/scala-akka</module>
<module>samples/client/petstore/scala-httpclient</module>
<module>samples/client/petstore/scalaz</module>
<module>samples/client/petstore/clojure</module>
<module>samples/client/petstore/java/feign</module>
<module>samples/client/petstore/java/jersey1</module>
<module>samples/client/petstore/java/jersey2</module>

View File

@ -38,12 +38,12 @@
(defn-spec delete-pet-with-http-info any?
"Deletes a pet"
([pet-id int?, ] (delete-pet-with-http-info pet-id nil))
([pet-id int?, {:keys [api-key]} (s/map-of keyword? any?)]
(check-required-params pet-id)
([petId int?, ] (delete-pet-with-http-info petId nil))
([petId int?, {:keys [api_key]} (s/map-of keyword? any?)]
(check-required-params petId)
(call-api "/pet/{petId}" :delete
{:path-params {"petId" pet-id }
:header-params {"api_key" api-key }
{:path-params {"petId" petId }
:header-params {"api_key" api_key }
:query-params {}
:form-params {}
:content-types []
@ -52,9 +52,9 @@
(defn-spec delete-pet any?
"Deletes a pet"
([pet-id int?, ] (delete-pet pet-id nil))
([pet-id int?, optional-params any?]
(let [res (:data (delete-pet-with-http-info pet-id optional-params))]
([petId int?, ] (delete-pet petId nil))
([petId int?, optional-params any?]
(let [res (:data (delete-pet-with-http-info petId optional-params))]
(if (:decode-models *api-context*)
(st/decode any? res st/string-transformer)
res))))
@ -113,10 +113,10 @@
(defn-spec get-pet-by-id-with-http-info any?
"Find pet by ID
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
[pet-id int?]
(check-required-params pet-id)
[petId int?]
(check-required-params petId)
(call-api "/pet/{petId}" :get
{:path-params {"petId" pet-id }
{:path-params {"petId" petId }
:header-params {}
:query-params {}
:form-params {}
@ -127,8 +127,8 @@
(defn-spec get-pet-by-id pet-spec
"Find pet by ID
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions"
[pet-id int?]
(let [res (:data (get-pet-by-id-with-http-info pet-id))]
[petId int?]
(let [res (:data (get-pet-by-id-with-http-info petId))]
(if (:decode-models *api-context*)
(st/decode pet-spec res st/string-transformer)
res)))
@ -160,11 +160,11 @@
(defn-spec update-pet-with-form-with-http-info any?
"Updates a pet in the store with form data"
([pet-id string?, ] (update-pet-with-form-with-http-info pet-id nil))
([pet-id string?, {:keys [name status]} (s/map-of keyword? any?)]
(check-required-params pet-id)
([petId string?, ] (update-pet-with-form-with-http-info petId nil))
([petId string?, {:keys [name status]} (s/map-of keyword? any?)]
(check-required-params petId)
(call-api "/pet/{petId}" :post
{:path-params {"petId" pet-id }
{:path-params {"petId" petId }
:header-params {}
:query-params {}
:form-params {"name" name "status" status }
@ -174,9 +174,9 @@
(defn-spec update-pet-with-form any?
"Updates a pet in the store with form data"
([pet-id string?, ] (update-pet-with-form pet-id nil))
([pet-id string?, optional-params any?]
(let [res (:data (update-pet-with-form-with-http-info pet-id optional-params))]
([petId string?, ] (update-pet-with-form petId nil))
([petId string?, optional-params any?]
(let [res (:data (update-pet-with-form-with-http-info petId optional-params))]
(if (:decode-models *api-context*)
(st/decode any? res st/string-transformer)
res))))
@ -184,23 +184,23 @@
(defn-spec upload-file-with-http-info any?
"uploads an image"
([pet-id int?, ] (upload-file-with-http-info pet-id nil))
([pet-id int?, {:keys [additional-metadata ^File file]} (s/map-of keyword? any?)]
(check-required-params pet-id)
([petId int?, ] (upload-file-with-http-info petId nil))
([petId int?, {:keys [additionalMetadata ^File file]} (s/map-of keyword? any?)]
(check-required-params petId)
(call-api "/pet/{petId}/uploadImage" :post
{:path-params {"petId" pet-id }
{:path-params {"petId" petId }
:header-params {}
:query-params {}
:form-params {"additionalMetadata" additional-metadata "file" file }
:form-params {"additionalMetadata" additionalMetadata "file" file }
:content-types ["multipart/form-data"]
:accepts []
:auth-names ["petstore_auth"]})))
(defn-spec upload-file any?
"uploads an image"
([pet-id int?, ] (upload-file pet-id nil))
([pet-id int?, optional-params any?]
(let [res (:data (upload-file-with-http-info pet-id optional-params))]
([petId int?, ] (upload-file petId nil))
([petId int?, optional-params any?]
(let [res (:data (upload-file-with-http-info petId optional-params))]
(if (:decode-models *api-context*)
(st/decode any? res st/string-transformer)
res))))

View File

@ -15,10 +15,10 @@
(defn-spec delete-order-with-http-info any?
"Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
[order-id string?]
(check-required-params order-id)
[orderId string?]
(check-required-params orderId)
(call-api "/store/order/{orderId}" :delete
{:path-params {"orderId" order-id }
{:path-params {"orderId" orderId }
:header-params {}
:query-params {}
:form-params {}
@ -29,8 +29,8 @@
(defn-spec delete-order any?
"Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
[order-id string?]
(let [res (:data (delete-order-with-http-info order-id))]
[orderId string?]
(let [res (:data (delete-order-with-http-info orderId))]
(if (:decode-models *api-context*)
(st/decode any? res st/string-transformer)
res)))
@ -62,10 +62,10 @@
(defn-spec get-order-by-id-with-http-info any?
"Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
[order-id string?]
(check-required-params order-id)
[orderId string?]
(check-required-params orderId)
(call-api "/store/order/{orderId}" :get
{:path-params {"orderId" order-id }
{:path-params {"orderId" orderId }
:header-params {}
:query-params {}
:form-params {}
@ -76,8 +76,8 @@
(defn-spec get-order-by-id order-spec
"Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions"
[order-id string?]
(let [res (:data (get-order-by-id-with-http-info order-id))]
[orderId string?]
(let [res (:data (get-order-by-id-with-http-info orderId))]
(if (:decode-models *api-context*)
(st/decode order-spec res st/string-transformer)
res)))

View File

@ -8,9 +8,9 @@
(def order-data
{
(ds/opt :id) int?
(ds/opt :pet-id) int?
(ds/opt :petId) int?
(ds/opt :quantity) int?
(ds/opt :ship-date) inst?
(ds/opt :shipDate) inst?
(ds/opt :status) string?
(ds/opt :complete) boolean?
})

View File

@ -12,7 +12,7 @@
(ds/opt :id) int?
(ds/opt :category) category-spec
(ds/req :name) string?
(ds/req :photo-urls) (s/coll-of string?)
(ds/req :photoUrls) (s/coll-of string?)
(ds/opt :tags) (s/coll-of tag-spec)
(ds/opt :status) string?
})

View File

@ -9,12 +9,12 @@
{
(ds/opt :id) int?
(ds/opt :username) string?
(ds/opt :first-name) string?
(ds/opt :last-name) string?
(ds/opt :firstName) string?
(ds/opt :lastName) string?
(ds/opt :email) string?
(ds/opt :password) string?
(ds/opt :phone) string?
(ds/opt :user-status) int?
(ds/opt :userStatus) int?
})
(def user-spec