-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
When generating a Clojure client for Kubernetes (v1.8.8), generated kubernetes.core/call-api
doesn't let */*
content type (value, which is passed as argument in various API calls, for example createBatchV1NamespacedJob
).
Swagger-codegen version
2.2.1
2.4.0-20180421.064157-234
Swagger declaration file content or url
Command line used for generation
java -jar swagger-codegen-cli-2.2.1.jar generate -i api.json -l clojure -o kubernetes
java -jar swagger-codegen-cli-2.4.0-20180421.064157-234.jar generate -i api.json -l clojure -o kubernetes
Steps to reproduce
- Generate api
- Call generated method, for example
(kubernetes.api.batch-v-/create-batch-v1-namespaced-job
"default"
{})
- Observe exception:
Unhandled java.lang.IllegalArgumentException
Content type "*/*" is not support for serialization
core.clj: 193 kubernetes.core/serialize
core.clj: 187 kubernetes.core/serialize
core.clj: 236 kubernetes.core/call-api
core.clj: 216 kubernetes.core/call-api
batch_v_.clj: 10 kubernetes.api.batch-v-/create-batch-v1-namespaced-job-with-http-info
batch_v_.clj: 5 kubernetes.api.batch-v-/create-batch-v1-namespaced-job-with-http-info
batch_v_.clj: 25 kubernetes.api.batch-v-/create-batch-v1-namespaced-job
batch_v_.clj: 20 kubernetes.api.batch-v-/create-batch-v1-namespaced-job
batch_v_.clj: 23 kubernetes.api.batch-v-/create-batch-v1-namespaced-job
batch_v_.clj: 20 kubernetes.api.batch-v-/create-batch-v1-namespaced-job
Related issues/PRs
There was a similar issue in the Java client
Suggest a fix/enhancement
Solution should probably reflect approach taken in Java code-gen module
I believe the problem lies in coercing */*
content type into application/json
.
https://gist.github.com/mewa/f302be76949026902155f14b88492502#file-kubernetes-core-clj-L172-L177
https://gist.github.com/mewa/f302be76949026902155f14b88492502#file-kubernetes-core-clj-L216-L242