Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2684
Closed
Open
Issue created Apr 17, 2019 by William Cheng@wing328Contributor5 of 6 checklist items completed5/6 checklist items

[BUG] scala-akka issues

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
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.

{"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

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.

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.

ContentType(MediaTypes.`application/json`)
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

Assignee
Assign to
Time tracking