Open wing328 opened 5 years ago
The scala-akka client has the following issues/limitations:
If a response is not documented, an exception will be thrown
The line for this behavior is https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala#L283
Enum (e..g status in Petstore) is converted to {}, e.g.
{}
{"id":1000,"category":{"id":1,"name":"sold"},"name":"dragon","photoUrls":["http://foo.com/photo/1","http://foo.com/photo/2","http://foo.com/photo/3","http://foo.com/photo/4","http://foo.com/photo/5","http://foo.com/photo/6","http://foo.com/photo/7","http://foo.com/photo/8","http://foo.com/photo/9","http://foo.com/photo/10"],"tags":[{"id":1,"name":"tag-1"},{"id":2,"name":"tag-2"},{"id":3,"name":"tag-3"},{"id":4,"name":"tag-4"},{"id":5,"name":"tag-5"}],"status":{}}
Note the "status":{} at the end of the payload
"status":{}
Removing https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/test/scala/PetApiTest.scala#L29 from the payload works around the issue for the time being.
Even content type is set to "application/json" in the request, still "applicatin/octat-stream" is used instead". The line seems to cause the issue is
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala#L290
I can workaround the issue by hard coding the following but it's clearly not going to work for all cases.
ContentType(MediaTypes.`application/json`)
Latest master
petstore.json/yaml
./bin/scala-akka-petstore.sh
Run "sbt test" under scala-akka petstore folder.
See above
p. 3 was fixed in https://github.com/OpenAPITools/openapi-generator/pull/5106 here i will create separate PR to cover this case with tests
Bug Report Checklist
Description
The scala-akka client has the following issues/limitations:
1. All responses must be documented.
If a response is not documented, an exception will be thrown
The line for this behavior is https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala#L283
2. Enum is not working as expected
Enum (e..g status in Petstore) is converted to
{}
, e.g.Note the
"status":{}
at the end of the payloadRemoving https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/test/scala/PetApiTest.scala#L29 from the payload works around the issue for the time being.
3. ContentType is not used in the request
Even content type is set to "application/json" in the request, still "applicatin/octat-stream" is used instead". The line seems to cause the issue is
https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala#L290
I can workaround the issue by hard coding the following but it's clearly not going to work for all cases.
openapi-generator version
Latest master
OpenAPI declaration file content or url
petstore.json/yaml
Command line used for generation
./bin/scala-akka-petstore.sh
Steps to reproduce
Run "sbt test" under scala-akka petstore folder.
Suggest a fix
See above